implemented call_user_func & call_user_func_array dynamic return type extensions#756
implemented call_user_func & call_user_func_array dynamic return type extensions#756staabm wants to merge 26 commits intophpstan:1.5.xfrom
call_user_func & call_user_func_array dynamic return type extensions#756Conversation
|
the syntax errors seem unrelated as these also happen on the master branch. this is good to go - I think. |
|
@ondrejmirtes should be ready to merge |
|
rebased against master. all green now. |
mglaman
left a comment
There was a problem hiding this comment.
I have a few thoughts, wondering if we could expand some of the testing and concerns of FuncCall when it's a StaticCall.
call_user_func & call_user_func_array dynamic return type extensions
There was a problem hiding this comment.
I have no idea yet on how to implement this cases, where only a unpack-array is passed, as I don't know how to split/what to pass into the FuncCall - which expects the name and args separated.
all other cases seem to pass right now
There was a problem hiding this comment.
I realized that in this variadic case I will let the extension just return the $defaultReturn
|
@ondrejmirtes any feedback on this PR? |
|
@staabm My top priority right now is PHP 8.1 support (https://phpstan.org/blog/plan-to-support-php-8-1). The main action is now happening in https://github.com/ondrejmirtes/BetterReflection/tree/ng and https://github.com/phpstan/phpstan-src/tree/ng-better-reflection. Once this is finished and released, the operations will return to normal eventually. I now have 187 emails in my inbox worthy of my attention (all related to PHPStan), so please stay tuned. |
|
@ondrejmirtes I see, thx for the update. if you see small issues I can fix to support you on the php 8.1 tasks, feel free to ping me |
There was a problem hiding this comment.
What is this entire codeblock about? Why are there instanceof specific AST nodes like Array_ and Variable?
There was a problem hiding this comment.
this block is about unwrapping the passed in array-arg so that each array-item can be re-wrapped into Arg objects and passed thru to the FuncCall
call_user_func_array('CallUserFuncArray\fun3', [1 ,2 ,3]) -> CallUserFuncArray\fun3(1, 2, 3);
ddd20b4 to
95d480b
Compare
|
Hi, I'm cleaning up old and stale PRs. Please send a new PR if you're still interested, thanks. This has been a draft for about a year. |
closes phpstan/phpstan#5942