Replies: 1 comment
-
Hi, this would be quite useful improvement 👍 In the end, it would be best to have simply refactor() method with both node and scope, like PHPStan. One way over optional is better design. Now it would be useful to have real data about how much scope attributes can we remove. Having one by one small PRs like we do parent/next/previous node. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
similar to #7849 I wonder whether we could get rid of the
AttributeKey::SCOPE
-attribute we attach on a lot of nodes, by consequently usingScopeAwarePhpRectorInterface
andrefactorWithScope
whereScope
is required?of course we would need to pass the
Scope
object thru some layers and helpers, but I think that it is done in phpstan and also in a lot of already existing functionalityAs I understood it, rector is constantly changing the scope while working thru the codebase and since a lot of nodes reference all these scope-objects involved, my thesis would be that php-src is not able to free the scope-objects memory, as they are still referenced in a lot of places.
is there are reason why sometimes the scope is retrieved from a node attribute instead of
refactorWithScope
?or should
refactorWithScope
work everywhere and it is just not done yet?any opinions?
Beta Was this translation helpful? Give feedback.
All reactions