Skip to content

[TASK] Require Rector with a caret constraint again - #139

Draft
Kanti wants to merge 3 commits into
mainfrom
rector-caret
Draft

Kanti wants to merge 3 commits into
mainfrom
rector-caret

Conversation

@Kanti

@Kanti Kanti commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Replaces #137. Instead of a tilde constraint (#136) and a pull request for every new minor version of Rector, we require Rector with a caret constraint again and rely on the nightly CI and phpstan/phpstan-deprecation-rules (#138) to notice breaking changes.

Changes

  • composer.json and packages/rector-p/composer.json: rector/rector: ^2.8.0 instead of ~2.8.0. The minimum stays 2.8.0, the first version in which the removed skips are deprecated (see AGENTS.md).
  • CONTRIBUTING.md (section "Rector version") and AGENTS.md: caret constraint, the nightly run of the grumphp workflow (no composer.lock, so it installs the newest Rector), what phpstan-deprecation-rules can and can not see, and to fix a breaking Rector release here or report it to the package that has to fix it.

Expected CI failure

There is no conflict with Rector 2.9, so CI installs Rector 2.9 and fails in the root jobs for two reasons:

  1. phpstan, all root jobs: src/RectorSettings.php:63 accesses Rector\Set\ValueObject\LevelSetList, which Rector 2.9 deprecates ("Use withPhpSets() or withPhpLevel() instead"). phpstan-deprecation-rules reports it before Rector removes the class. Rector 2.9 also warns at runtime about the per-version PHP set files (config/set/phpXY.php, config/set/level/up-to-phpXY.php); the replacement SetList::PHP_VERSION_BASED_SET exists since Rector 2.8.0. Not fixed yet.
  2. rector, TYPO3 jobs: ssch/typo3-rector 3.17.0 (still the latest release) uses Rector\Transform\ValueObject\MethodCallToStaticCall, which Rector 2.9.0 removed ([Transform] Remove 7 deprecated rules rectorphp/rector-src#8958).

The packages are green.

Notes

  • The nightly only notices a breaking Rector release, it does not protect the projects: they get a new Rector version with their next composer update, at the same time.
  • phpstan-deprecation-rules does not see constants read with constant() (like SetList::PHP_* in RectorSettings::sets()), and it does not check other packages such as ssch/typo3-rector.
  • We asked the Rector maintainers about their versioning: Question: Does Rector intend to follow Semantic Versioning? rectorphp/rector#9977.

Instead of a tilde constraint and a pull request for every new minor
version of Rector, require ^2.8.0 and rely on the nightly CI and
phpstan-deprecation-rules to notice breaking changes.

ssch/typo3-rector 3.17.0 does not work with Rector 2.9 yet, so Rector
>=2.9.0 conflicts until it does.
The CI shows that ssch/typo3-rector 3.17.0 does not work with
Rector 2.9 (sabbelasichon/typo3-rector#4957) until a fixed release is
out (sabbelasichon/typo3-rector#4958).
@Kanti

Kanti commented Nov 27, 2026

Copy link
Copy Markdown
Member Author

@copilot resolve the merge conflicts in this pull request

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved and merged main in c485ba6. Composer manifests validate; local GrumPHP and PHPUnit checks are blocked by dependency installation (PHP security advisory constraint and GitHub download authentication).

This branch has not been deployed

No deployments
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.

2 participants