Repository navigation
#55 - Use the PHP 8.3 to 8.5 functions through the Symfony polyfills, and configure Rector accordingly - #56
Merged
Merged
Conversation
…olyfills, and configure Rector accordingly - Require symfony/polyfill-php83, symfony/polyfill-php84 and symfony/polyfill-php85 (^1.33) - Rector: withPhpVersion(PHP_82) instead of PHP_85, withPhpSets() read from composer.json instead of the php81 leftover of #20 (also enables the polyfill rules), remove the redundant UP_TO_PHP_82 set; no change proposed on the current code - CONTRIBUTING: document the PHP version policy - CHANGELOG Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #55: use the functions of PHP 8.3 to 8.5 safely while supporting PHP 8.2, and align the Rector configuration with the minimum PHP version. Same change as cleverage/process-bundle#299.
Changes
symfony/polyfill-php83,symfony/polyfill-php84andsymfony/polyfill-php85(^1.33). They are empty on the PHP versions having the functions natively.withPhpVersion(PhpVersion::PHP_82)instead ofPHP_85: no syntax above PHP 8.2;withPhpSets()without explicit version (read fromcomposer.json) instead ofphp81: true. This was a leftover: Upgrade to Symfony 7.3 & PHP 8.4 #20 (8464e81) configured Rector for PHP 8.1 when it was the minimum version, then Upgrade to Symfony 7.4 | 8.0 & PHP 8.5 #22 (6444aec) raisedcomposer.jsonto"php": ">=8.2"without updatingrector.php. The PHP 8.2 rules now apply as in the other bundles, and Rector adds itsPHP_POLYFILLSset (the rules using a newer function apply whencomposer.jsonrequires the matchingsymfony/polyfill-phpXX; an explicit version is a ceiling and skips them);LevelSetList::UP_TO_PHP_82removed (redundant withwithPhpSets()).readonlyclass since all task classes have mutable properties, nor polyfill rules), so no BC-sensitive change had to be skipped.FileFetchTask::execute()/next()(current()/next()on$matchingFiles) andListContentTask::execute()/next()(key()/current()/next()on$fsContent): not changed, the internal array pointer is actually used to iterate acrossexecute()/next()calls,array_first()/array_key_first()would always return the first element.foreachloops ofFileFetchTask::findMatchingFiles(),ListContentTask::getFilteredFilesystemContents()andRemoveFileTask::execute()filter or act on every item (they iterate FlysystemDirectoryListingobjects, not arrays): no find/any/all pattern.json_decode,trim,ucfirst,str_padusage.src/andtests/: none.Checks
--prefer-lowest(the three polyfills installed).Requirements
Breaking changes
None: three new small dependencies (polyfills), no change of the minimum PHP version.
🤖 Generated with Claude Code