Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[deprecation] Deprecate AbstractScopeAwareRector in favor of single AbstractRector #6425

Merged
merged 2 commits into from
Nov 12, 2024

Conversation

TomasVotruba
Copy link
Member

@TomasVotruba TomasVotruba commented Nov 12, 2024

With upcoming php-parser 5 and PHPStan 2 BC breaks, it's ideal time to cleanup some deprecated code and bad design choices :)

The Rector\Rector\AbstractScopeAwareRector is first of them. This "handy class" is too granular just to fetch single helper object. It makes creating new custom rules ambiguous, one layer more complex and confusing.

It will be removed in favor of standard AbstractRector and Scope object can be fetched via ScopeFetcher.

That way you can use single class for all rules, and fetch scope when and where needed.

@TomasVotruba TomasVotruba force-pushed the tv-upgrading-depre-scopeaware branch from b5f8c05 to e30c7af Compare November 12, 2024 21:53
@TomasVotruba TomasVotruba merged commit c2053c7 into main Nov 12, 2024
36 checks passed
@TomasVotruba TomasVotruba deleted the tv-upgrading-depre-scopeaware branch November 12, 2024 22:20
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.

1 participant