Skip to content

Commit

Permalink
chore: officially support PHP 8.3 (#7466)
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Nov 26, 2023
1 parent d50d5b6 commit 45a4530
Show file tree
Hide file tree
Showing 13 changed files with 87 additions and 75 deletions.
2 changes: 1 addition & 1 deletion .github/composite-actions/install-composer-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ runs:
Composer-${{ runner.os }}-
- name: Auto-add ignore-platform-req
uses: actions/github-script@v6
uses: actions/github-script@v7
id: resolve-ignore-platform-req
with:
script: 'return ${{ env.PHP_VERSION_ID }} >= 80300 ? "--ignore-platform-req=php+" : ""'
Expand Down
34 changes: 22 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ concurrency:
cancel-in-progress: true

env:
PHP_MAX: '8.2'
PHP_MAX: '8.3'
PHP_MIN: '7.4'

jobs:
Expand Down Expand Up @@ -68,67 +68,77 @@ jobs:
run-tests: 'yes'

- operating-system: 'ubuntu-20.04'
php-version: '8.2'
php-version: '8.3'
job-description: 'Fixer'
run-fixer: 'yes'

- operating-system: 'ubuntu-20.04'
php-version: '8.3'
job-description: 'tests'
run-tests: 'yes'

- operating-system: 'ubuntu-20.04'
php-version: '8.3'
job-description: 'Fixer with migration rules'
run-fixer: 'yes'
run-migration-rules: 'yes' # should be checked on the highest supported PHP version

- operating-system: 'ubuntu-20.04'
php-version: '8.2'
php-version: '8.3'
job-description: 'tests with migration rules'
run-tests: 'yes'
run-migration-rules: 'yes' # should be checked on the highest supported PHP version

- operating-system: 'ubuntu-20.04'
php-version: '8.2'
php-version: '8.3'
job-description: 'Fixer with Symfony ^7'
run-fixer: 'yes'
execute-flex-with-symfony-version: '^7' # explicit check for Symfony 7.x compatibility

- operating-system: 'ubuntu-20.04'
php-version: '8.2'
php-version: '8.3'
job-description: 'tests with Symfony ^7'
run-tests: 'yes'
execute-flex-with-symfony-version: '^7' # explicit check for Symfony 7.x compatibility

- operating-system: 'ubuntu-20.04'
php-version: '8.2'
php-version: '8.3'
job-description: 'code coverage'
run-tests: 'yes'
collect-code-coverage: 'yes'

- operating-system: 'windows-latest'
php-version: '8.2'
php-version: '8.3'
job-description: 'Fixer on Windows'
run-fixer: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional

- operating-system: 'windows-latest'
php-version: '8.2'
php-version: '8.3'
job-description: 'tests on Windows'
run-tests: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional systems

- operating-system: 'macos-latest'
php-version: '8.2'
php-version: '8.3'
job-description: 'Fixer on macOS'
run-fixer: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional systems

- operating-system: 'macos-latest'
php-version: '8.2'
php-version: '8.3'
job-description: 'tests on macOS'
run-tests: 'yes'
FAST_LINT_TEST_CASES: 1 # we need full syntax check on one job at least, no need to do it on additional

- operating-system: 'ubuntu-22.04'
php-version: '8.3'
php-version: '8.4'
job-description: 'Fixer'
run-fixer: 'yes'
PHP_CS_FIXER_IGNORE_ENV: 1

- operating-system: 'ubuntu-22.04'
php-version: '8.3'
php-version: '8.4'
job-description: 'tests'
run-tests: 'yes'
PHP_CS_FIXER_IGNORE_ENV: 1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sca.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
operating-system:
- ubuntu-20.04
php-version:
- 8.2
- 8.3

name: Static Code Analysis

Expand Down
6 changes: 3 additions & 3 deletions .php-cs-fixer.php-highest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* with this source code in the file LICENSE.
*/

if (PHP_VERSION_ID < 8_02_00 || PHP_VERSION_ID >= 8_03_00) {
fwrite(STDERR, "PHP CS Fixer's config for PHP-HIGHEST can be executed only on highest supported PHP version - 8.2.*.\n");
if (PHP_VERSION_ID < 8_03_00 || PHP_VERSION_ID >= 8_04_00) {
fwrite(STDERR, "PHP CS Fixer's config for PHP-HIGHEST can be executed only on highest supported PHP version - 8.3.*.\n");
fwrite(STDERR, "Running it on lower PHP version would prevent calling migration rules.\n");

exit(1);
Expand All @@ -22,7 +22,7 @@
$config = require __DIR__.'/.php-cs-fixer.dist.php';

$config->setRules(array_merge($config->getRules(), [
'@PHP82Migration' => true,
'@PHP83Migration' => true,
'@PHP80Migration:risky' => true,
]));

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ projects. This tool does not only detect them, but also fixes them for you.
* PHP 8.0 (except PHP 8.0.0 due to [bug in PHP tokenizer](https://bugs.php.net/bug.php?id=80462))
* PHP 8.1
* PHP 8.2
* PHP 8.3

> **Note**
> Each new PHP version requires a huge effort to support the new syntax.
Expand Down
2 changes: 1 addition & 1 deletion compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ services:
<<: *php
build:
args:
PHP_VERSION: "8.3.0RC6"
PHP_VERSION: "8.3"
PHP_XDEBUG_VERSION: "3.3.0alpha3"
3 changes: 2 additions & 1 deletion dev-tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ dev-tools/bin/box compile

# revert changes to composer
git checkout composer.json
composer update --optimize-autoloader --no-interaction --no-progress --no-scripts -q
PHP83HACK=--ignore-platform-req=PHP+ # for building on local machine
composer update --optimize-autoloader --no-interaction --no-progress --no-scripts -q $PHP83HACK
4 changes: 2 additions & 2 deletions dev-tools/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"php": "^8.2",
"php": "^8.3",
"ergebnis/composer-normalize": "^2.39.0",
"jangregor/phpstan-prophecy": "^1.0.0",
"maglnet/composer-require-checker": "^4.7.1",
Expand All @@ -19,7 +19,7 @@
},
"optimize-autoloader": true,
"platform": {
"php": "8.2"
"php": "8.3"
},
"prefer-stable": true,
"sort-packages": true
Expand Down

0 comments on commit 45a4530

Please sign in to comment.