diff --git a/CHANGELOG.md b/CHANGELOG.md index 054b1ad..fca379a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ Latest ------ ### Changes +* [#56](https://github.com/cleverage/rest-process-bundle/issues/56) Require `symfony/polyfill-php83`, `symfony/polyfill-php84` and `symfony/polyfill-php85` ([cleverage/process-bundle#299](https://github.com/cleverage/process-bundle/issues/299)): the functions of PHP 8.3 to 8.5 can be used while supporting PHP 8.2. Rector targets PHP 8.2 (`withPhpVersion()`, `withPhpSets()` read from `composer.json`) and applies the rules using a newer function when its polyfill is required (no change needed in the current code). * [#52](https://github.com/cleverage/rest-process-bundle/issues/52) Give a code to the task ([cleverage/process-bundle#91](https://github.com/cleverage/process-bundle/issues/91)): `rest_request` (`task: rest_request`, with `cleverage/process-bundle` 5.4 or later, referencing it by `service` being deprecated there). The task has its class name as service id; fetching it directly from the service container is deprecated (`container.private`), it will be private in 4.0. The former id `cleverage_rest_process.task.request` is a deprecated alias, removed in 4.0. Update documentation, add tests. * [#50](https://github.com/cleverage/rest-process-bundle/issues/50) CI: test the lowest versions allowed by `composer.json` (`--prefer-lowest`, PHP 8.2). Raise `psr/log` to `^2 || ^3`: `cleverage/process-bundle` loggers and the test loggers use the typed `log()` signature, a fatal error with `psr/log` 1. * [#48](https://github.com/cleverage/rest-process-bundle/issues/48) `Client::geUri()` (deprecated since v3.2, use `getUri()`) triggers a deprecation at runtime with `trigger_deprecation()` (`symfony/deprecation-contracts`, now required). Add tests. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9a8dfba..23ed8e4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,6 +40,14 @@ make quality make tests ``` +## PHP version + +The bundle supports PHP 8.2 and later: do not use a syntax introduced by a later version (typed class constants, +property hooks, pipe operator...). The functions of PHP 8.3 to 8.5 (`json_validate()`, `array_find()`, `array_any()`, +`mb_trim()`, `array_first()`...) can be used: they are provided by the required `symfony/polyfill-php83`, +`symfony/polyfill-php84` and `symfony/polyfill-php85` packages on the older versions. Rector (`make quality`) is +configured accordingly. + ## Deprecations notices When a feature should be deprecated, or when you have a breaking change for a future version, please : diff --git a/composer.json b/composer.json index f9a13a3..48ee50f 100644 --- a/composer.json +++ b/composer.json @@ -59,7 +59,10 @@ "symfony/http-client": "^6.4 || ^7.4 || ^8", "symfony/http-client-contracts": "^3", "symfony/http-kernel": "^6.4 || ^7.4 || ^8", - "symfony/options-resolver": "^6.4 || ^7.4 || ^8" + "symfony/options-resolver": "^6.4 || ^7.4 || ^8", + "symfony/polyfill-php83": "^1.33", + "symfony/polyfill-php84": "^1.33", + "symfony/polyfill-php85": "^1.33" }, "require-dev": { "friendsofphp/php-cs-fixer": "*", diff --git a/rector.php b/rector.php index 7628528..a601b30 100644 --- a/rector.php +++ b/rector.php @@ -3,23 +3,21 @@ declare(strict_types=1); use Rector\Config\RectorConfig; -use Rector\Set\ValueObject\LevelSetList; use Rector\Symfony\Set\SymfonySetList; use Rector\ValueObject\PhpVersion; return RectorConfig::configure() - ->withPhpVersion(PhpVersion::PHP_85) + ->withPhpVersion(PhpVersion::PHP_82) ->withPaths([ __DIR__.'/src', __DIR__.'/tests', ]) - ->withPhpSets(php82: true) + ->withPhpSets() // here we can define, what prepared sets of rules will be applied ->withComposerBased(phpunit: true, symfony: true) ->withPreparedSets(deadCode: true, codeQuality: true, symfonyCodeQuality: true) ->withAttributesSets(symfony: true) ->withSets([ - LevelSetList::UP_TO_PHP_82, SymfonySetList::SYMFONY_CONSTRUCTOR_INJECTION, ]) ;