Repository navigation
Fix fatal error on dynamic method names in assignments - #143
Merged
Merged
Conversation
Co-authored-by: iMattPro <303711+iMattPro@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix fatal error caused by undefined method in Reactions extension
Fix fatal error on dynamic method names in assignments
Nov 1, 2026
Co-authored-by: iMattPro <303711+iMattPro@users.noreply.github.com>
Co-authored-by: iMattPro <303711+iMattPro@users.noreply.github.com>
Contributor
Author
Added |
Co-authored-by: iMattPro <303711+iMattPro@users.noreply.github.com>
iMattPro
requested changes
Nov 1, 2026
iMattPro
left a comment
Member
There was a problem hiding this comment.
What are all these lint files you added to the bin dir? That's not what I asked for. And why are phpunit results caches added to gitignore - also something we've not needed before. Get rid of this noise!
Co-authored-by: iMattPro <303711+iMattPro@users.noreply.github.com>
iMattPro
approved these changes
Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EPV crashed with
Call to undefined method PhpParser\Node\Expr\ArrayDimFetch::toString()when scanning an assignment whose right-hand side is a method call with an array-indexed dynamic name, e.g.$removed = $this->store->{$methods[$step]}(self::DELETE_STEP);.Root cause
validateMethodCalls, the assignment branch ($node->expris aMethodCall) skipped only a fixed list of name node types:Variable,PropertyFetch,Concat,EncapsedandTernary.$node->expr->name->toString().ArrayDimFetchwas one of them, and it has notoString().Change
src/Tests/Tests/epv_test_validate_php_functions.php.toString()is now called only when the name is aNode\IdentifierorNode\Name, which are the only types that have it.Not run: the checkout had no
vendordirectory, so onlyphp -lwas run. I didn't add a regression test or try the zip from the issue. It's worth checking$x = $obj->{$arr[$i]}()against the real extension.