Skip to content

[NodeVisitor] Skip array callable decoration on calls without scope - #9076

Open
kk-daniel wants to merge 1 commit into
rectorphp:mainfrom
kattokeskus:rector-trait-attribute-scope
Open

kk-daniel wants to merge 1 commit into
rectorphp:mainfrom
kattokeskus:rector-trait-attribute-scope

Conversation

@kk-daniel

Copy link
Copy Markdown
Contributor

Rector crashes with Scope not available on "PhpParser\Node\Expr\New_" node when a trait's own attribute has new with a two-item array argument:

#[SomeAttribute(new \ArrayObject([1, 2]))]
trait SomeTrait {}

Demo: https://getrector.com/demo/5b88a9c0-e0bd-4286-9204-5cf340a57d40
Repro: https://github.com/kk-daniel/rector-scope-not-available-repro

Regression since 2.8.0. #8552 removed decorateNodeAttrGroups(), so trait attribute args no longer get a scope. This skips the decoration when the call has no scope.

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