Repository navigation
Inline deprecated symplify/rule-doc-generator-contracts under Rector\RuleDoc - #8586
Merged
Merged
Conversation
…RuleDoc The symplify/rule-doc-generator-contracts package is deprecated. Move its classes into src/RuleDoc under the Rector\RuleDoc namespace and drop the dependency. A BC alias layer (src/functions/rule_doc_generator_class_aliases.php) maps the old Symplify\RuleDocGenerator\* FQCNs onto the new ones, so extension and 3rd party rules that reference the old namespace keep working unchanged. The scoper exclude for that namespace is kept so the alias names stay unprefixed in the built PHAR.
TomasVotruba
force-pushed
the
inline-rule-doc-contracts
branch
from
October 10, 2026 10:00
fb1fff3 to
b8bc004
Compare
Drops the hard skip that bails out before refactor() when a node was already rectified by the same rule or just reprinted without a refreshed scope. Breaks ChangeSwitchTernaryTest: a rule firing on a freshly reprinted Expression node hits ScopeFetcher::fetch() on a scopeless node and throws 'Scope not available'. The guard was the safety net for that case (and for consecutive CREATED_BY_RULE re-application loops).
This was referenced Oct 10, 2026
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.
symplify/rule-doc-generator-contractsis deprecated. This moves its classes intosrc/RuleDocunder theRector\RuleDocnamespace and drops the dependency.What changed
src/RuleDoc/(Contract,ValueObject,Exception), namespaceRector\RuleDoc\*Symplify\RuleDocGenerator\*toRector\RuleDoc\*symplify/rule-doc-generator-contractsremoved fromcomposer.jsonBackward compatibility
A thin alias layer (
src/functions/rule_doc_generator_class_aliases.php, wired viaautoload.files) maps every oldSymplify\RuleDocGenerator\*FQCN onto the new class. Extension packages (doctrine, symfony, phpunit, downgrade) and 3rd party rules that still reference the old namespace keep working unchanged - no code change required on their side.The
#^Symplify\RuleDocGenerator#scoper exclude is kept so the alias names stay unprefixed in the built PHAR, same as before.Fixture/Source stubs intentionally keep the old namespace - they ride the alias and act as a live BC check.