fix: conflict with rector/rector >=2.6.2 (#420) - #421
Merged
Merged
Conversation
Rector 2.6.2 removed every version-specific set constant from its first-party extension packages in favour of the new composer-based sets (rectorphp/rector-phpunit#760). The Drupal 8, 9 and 10 configs reference those constants directly, so from 2.6.2 on they abort before any rule runs. Bisected against real installs; 2.6.1 is the last release on which every Drupal set loads: 2.5.9 / 2.6.0 / 2.6.1 ok 2.6.2 / 2.6.3 / 2.6.6 fail Breakage map on 2.6.6: DRUPAL_90, DRUPAL_100 Could not detect twig set. DRUPAL_91, DRUPAL_92 Undefined constant PHPUnitSetList::PHPUNIT_90 DRUPAL_101 Undefined constant SymfonySetList::SYMFONY_63 DRUPAL_102 Undefined constant SymfonySetList::SYMFONY_64 plus the DRUPAL_8 / DRUPAL_9 / DRUPAL_10 aggregates that include them. The Drupal 11 and 12 sets reference no third-party sets and are unaffected. A conflict rather than a narrowed require constraint, so the supported range stays documented as ^2 and composer reports the incompatibility by name. This is a stopgap to keep installs working. The real fix is porting the sets to the composer-based mechanism (#419), which Rector 2.6.6 already expects: withComposerBased(drupal: true) resolves DrupalRector\Set\DrupalSetList:: COMPOSER_BASED, and SetGroup::DRUPAL is now marked deprecated upstream in favour of a composer-based.php set. The conflict is lifted once that lands. Reported by ptmkenny in #420
…ationConstructor Unrelated to #420, but the codestyle job is failing on main's code and blocks this branch. The @symfony ruleset in php-cs-fixer 3.95.24 enforces nullable_type_declaration with the question_mark style. The dev constraint is ^3.95.1, so the rule arrived by a floating minor rather than by any change here — the file has been unchanged since it was merged green. Only the php-cs-fixer job would have caught it, and the scheduled runs cover phpstan, phpunit and functional tests only, so it went unnoticed. No behavior change; ?int and null|int are the same type.
This was referenced Sep 3, 2026
bbrala
added a commit
that referenced
this pull request
Sep 3, 2026
The codestyle job only ran on push to main and on pull requests, so a php-cs-fixer release that adds or changes a rule went unnoticed until it surfaced in an unrelated PR. That is what happened on #421: the @symfony ruleset in php-cs-fixer 3.95.24 enforces nullable_type_declaration with the question_mark style, and the dev constraint is ^3.95.1, so the rule arrived by a floating minor. It failed a composer.json-only change on a file untouched since it merged green in July. phpstan, phpunit and functional tests already run weekly for the same reason (catching rector changes); codestyle was the one left out. composer.lock is not committed, so composer install resolves fresh on every run and the scheduled job genuinely picks up new php-cs-fixer releases. Same cron as the other three workflows, 00:00 UTC on Sunday. Scheduled workflows only run from the default branch, so this takes effect once merged. Note this detects drift rather than preventing it. Pinning php-cs-fixer to an exact version would prevent it instead, at the cost of manual bumps; the weekly run was preferred so new rules still get picked up, just on a predictable schedule rather than in whichever PR happens to be open.
Merged
6 tasks
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.
Stopgap for #420 so the next release installs and runs.
Rector 2.6.2 removed every version-specific set constant from its first-party extension packages in favour of the new composer-based sets (rectorphp/rector-phpunit#760). The Drupal 8, 9 and 10 configs reference those constants directly, so from 2.6.2 on they abort before any rule runs.
Verified boundary
Bisected against real installs rather than the release notes — 2.6.1 is the last release on which every Drupal set loads:
Drupal10SetList::DRUPAL_100[ERROR] Could not detect twig set.Breakage map on 2.6.6
DRUPAL_90,DRUPAL_100Could not detect twig set.DRUPAL_91,DRUPAL_92Undefined constant …PHPUnitSetList::PHPUNIT_90DRUPAL_101Undefined constant …SymfonySetList::SYMFONY_63DRUPAL_102Undefined constant …SymfonySetList::SYMFONY_64DRUPAL_8*,DRUPAL_103, all D11 / D12Plus the
DRUPAL_8/DRUPAL_9/DRUPAL_10aggregates that include the broken per-minor configs. The Drupal 11 and 12 sets reference no third-party sets and are unaffected.The change
A
conflictrather than a narrowedrequire, so the supported range stays documented as^2and composer reports the incompatibility by name:Re-resolving
^2now lands on 2.6.1.Trade-off
>=2.6.2also holds back Drupal 11 users who would otherwise be fine on 2.6.6. That is deliberate for a stopgap — a partial break where D9/D10 users hit a hard error is worse than a loud install-time refusal, and the alternative (defined()guards around the missing constants, asdrupal-9.0-deprecations.phpalready does forTWIG_24/TWIG_240) would degrade silently.Follow-up
The real fix is porting the sets to the composer-based mechanism, #419. Rector 2.6.6 already expects it:
withComposerBased(drupal: true)resolvesDrupalRector\Set\DrupalSetList::COMPOSER_BASED, andSetGroup::DRUPALis now marked@deprecated Use composer-based.php set instead— so the currentDrupalSetProvider/ComposerTriggeredSetapproach is on the deprecated path upstream. The conflict is lifted once that lands.Gates
RemoveToolkitArgFromImageToolkitOperationConstructorRector.php(null|int→?int), confirmed present onmainwithout this changeReported by @ptmkenny.
Second commit: unrelated codestyle fix
The
php-cs-fixerjob was failing on code this PR does not touch, which blocked the branch. The@Symfonyruleset in php-cs-fixer 3.95.24 enforcesnullable_type_declarationwith thequestion_markstyle; the dev constraint is^3.95.1, so the rule arrived via a floating minor rather than any change here.RemoveToolkitArgFromImageToolkitOperationConstructorRector.phphas been unchanged since it merged green, and only the php-cs-fixer job catches this — the scheduled runs cover phpstan, phpunit and functional tests only, so it went unnoticed onmain.Kept as its own commit (
null|int→?int, no behavior change) so it stays separable from the conflict change.