Skip to content

#51 - Use the PHP 8.3 to 8.5 functions through the Symfony polyfills, and configure Rector accordingly - #52

Merged
njoubert-cleverage merged 1 commit into
mainfrom
51
Oct 15, 2026
Merged

njoubert-cleverage merged 1 commit into
mainfrom
51

Conversation

@njoubert-cleverage

Copy link
Copy Markdown
Member

Fixes #51

Description

Same change as cleverage/process-bundle#299 (PR cleverage/process-bundle#300), for this bridge.

Changes

  • composer.json: require symfony/polyfill-php83, symfony/polyfill-php84 and symfony/polyfill-php85 (^1.33).
  • rector.php: withPhpVersion(PhpVersion::PHP_82) (was PHP_85, inconsistent with php >=8.2), withPhpSets() without explicit version (adds Rector's PHP_POLYFILLS set: the rules using a newer function apply when the matching polyfill is required), remove the redundant LevelSetList::UP_TO_PHP_82 and its use.
  • Rector rules applied: none, Rector 2.7.0 finds nothing to change with the new configuration.
  • Manual replacements: none. The code is small and has no candidate with a strictly identical behaviour:
    • RegisterAdaptersPass::process() and CleverAgeCacheProcessExtension::findServices(): foreach loops with side effects (method calls, file loading), not searches / any / all tests; the latter iterates a Finder (iterator, not an array).
    • AdapterRegistry: array_key_exists() lookups by key, nothing for array_find*().
    • tests/CleverAgeCacheProcessBundleTest::testAdaptersPassIsRegistered(): array_filter() + assertCount(1, ...) asserts that the pass is registered exactly once; array_any() would only check at least once (weaker assertion).
    • No reset() / current() / end() / key(), json_decode(), trim() or ucfirst() call in src/ (the reset() matches in tests are ProcessState::reset()).
  • Pre-existing uses of PHP 8.3+ functions: none in src/ and tests/ (nothing relied on a transitive polyfill).
  • CONTRIBUTING.md: new "PHP version" section.
  • CHANGELOG.md: entry in the "Latest" section.

Checks

  • Tests, highest dependencies (PHP 8.5): OK (61 tests, 127 assertions); with coverage (pcov, as the CI): OK, no risky test, lines 100% (78/78).
  • Tests, lowest dependencies (--prefer-lowest, PHP 8.2): OK (61 tests, 127 assertions), symfony/polyfill-php83, -php84 and -php85 installed.
  • PHPStan: no errors.
  • PHP-CS-Fixer: no change.
  • Rector: no change.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: three new small dependencies (polyfills), no change of the minimum PHP version.

🤖 Generated with Claude Code

…olyfills, and configure Rector accordingly

- Require symfony/polyfill-php83, symfony/polyfill-php84 and symfony/polyfill-php85 (^1.33), as in cleverage/process-bundle#299
- Rector: withPhpVersion(PhpVersion::PHP_82), the minimum supported version (was PHP_85), and withPhpSets() without explicit version, which adds the PHP_POLYFILLS set; remove the redundant LevelSetList::UP_TO_PHP_82
- No Rector rule applies on the current code, no manual replacement applies
- CONTRIBUTING: add a "PHP version" section
- Update CHANGELOG

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@njoubert-cleverage
njoubert-cleverage merged commit 515cbf0 into main Oct 15, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use the PHP 8.3 to 8.5 functions through the Symfony polyfills, and configure Rector accordingly

1 participant