Skip to content

Conversation

@phansys
Copy link
Contributor

@phansys phansys commented Jun 24, 2024

Type: bug report
Issue: n/a
Breaking change: no (at least, not yet)

IIUC, MethodNode::isDeclaration() is not working as expected, because methods overriding or implementing parent classes or interfaces are being interpreted as declarations.

The added test tries to expose the described issue.

@phansys
Copy link
Contributor Author

phansys commented Jun 24, 2024

Do you know if there is any init process or something else I might be missing?

I suspect that the related ASTs for the ClassNode containing the MethodNode (parent classes, interfaces) are not being built correctly, but I don't know if there is an explicit instruction or configuration for that.

@AJenbo
Copy link
Member

AJenbo commented Jun 24, 2024

i would try targeting 3.x instead, things are simpler, cleaner and you get full phpstan checks on your changes.

@phansys
Copy link
Contributor Author

phansys commented Jun 24, 2024

i would try targeting 3.x instead, things are simpler, cleaner and you get full phpstan checks on your changes.

I'll try to create a new PR against 3.x, thanks for pointing 👍
Although I think this PR should be kept for 2.x, as the described problem is affecting this version.

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.

2 participants