Skip to content

Fixing this in anonoymous class#2469

Merged
dantleech merged 2 commits into
phpactor:masterfrom
mamazu:fixing_this_in_anonoymous_class
Dec 22, 2023
Merged

Fixing this in anonoymous class#2469
dantleech merged 2 commits into
phpactor:masterfrom
mamazu:fixing_this_in_anonoymous_class

Conversation

@mamazu
Copy link
Copy Markdown
Contributor

@mamazu mamazu commented Dec 21, 2023

Fixes #2467

TraitDeclaration::class,
EnumDeclaration::class
EnumDeclaration::class,
ObjectCreationExpression::class, // For Inline classes
Copy link
Copy Markdown
Collaborator

@dantleech dantleech Dec 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure this will work as object creation expressions are typically inside class declarations etc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have looked at the node tree. And where a normal definition has a ClassDefinitionNode there is an ObjectCreactionExpression

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah i see, i'm confusing ancestor and descendant 🤦

@mamazu mamazu force-pushed the fixing_this_in_anonoymous_class branch from aa13c62 to a825957 Compare December 21, 2023 21:09
@dantleech dantleech merged commit ca4c10d into phpactor:master Dec 22, 2023
@dantleech
Copy link
Copy Markdown
Collaborator

the next bit would probably be adding a new AnonymousClassType implementing ClassLikeType and adding the class members to it, probably quite some work to do there.

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.

$this not recognized inside anonymous class

2 participants