Support call_user_func_array#5286
Conversation
|
This pull request has been marked as ready for review. |
src/Analyser/ArgumentsNormalizer.php
Outdated
| $calledOnType = $scope->getType($callbackArg->value); | ||
| if (!$calledOnType->isCallable()->yes()) { | ||
| return null; | ||
| } |
There was a problem hiding this comment.
since the following loop might return early, we could move this 4 lines nearer to the usage in line 174 to prevent unnecessary work
| } | ||
| $this->analyse([__DIR__ . '/data/call-user-func-array.php'], $errors); | ||
| $this->analyse([__DIR__ . '/data/call-user-func-array-named-args.php'], $errors); | ||
| } |
There was a problem hiding this comment.
is call-user-func-array.php no longer tested in this rule?
There was a problem hiding this comment.
I just renamed the initial call-user-func-array.php file
There was a problem hiding this comment.
interessting.. the PR does not include a file which got renamed?
|
issue-bot shows a new error with phpstan/phpstan#8214 .. might indicate we miss splat operator support...? |
The phpdoc of the snippet is so the error is legit |

Extracted from #5282
This copy the existing behavior of
call_user_funcbut forcall_user_func_array.Closes phpstan/phpstan#5942
Closes phpstan/phpstan#5934