Skip to content

Early downgrade RuleDoc classes in scoped build - #8592

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-downgrade-ruledoc-scoped-build
Oct 10, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-downgrade-ruledoc-scoped-build

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

The scoped build (which publishes rectorphp/rector) fails at the PHP 7.4 lint step:

PHP Parse error: syntax error, unexpected 'array' (T_ARRAY), expecting variable
  in src/RuleDoc/RuleDefinition.php on line 24

The inlined Rector\RuleDoc classes are registered as BC aliases from src/functions/rule_doc_generator_class_aliases.php, which is a composer files autoload - so it runs on bootstrap and eagerly loads those classes. During the 7.4 phase of the scoped build the still-8.x source gets parsed and fatals. Previously these classes lived in the symplify/rule-doc-generator-contracts vendor package and were never autoloaded eagerly.

Same pattern already used for the other files autoload entry (node_helper.php): downgrade it early, under PHP 8.4, before the version switch. This extends that step to src/RuleDoc, so the class-alias bootstrap can load them under 7.4.

@TomasVotruba
TomasVotruba merged commit f6741cc into main Oct 10, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-downgrade-ruledoc-scoped-build branch October 10, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant