Skip to content

Commit

Permalink
Handle first-class callable in yield types
Browse files Browse the repository at this point in the history
  • Loading branch information
trowski committed Dec 27, 2021
1 parent e23a915 commit 87160c8
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -352,7 +352,12 @@ protected static function getYieldTypeFromExpression(
if ($stmt instanceof PhpParser\Node\Expr\MethodCall
|| $stmt instanceof PhpParser\Node\Expr\FuncCall
|| $stmt instanceof PhpParser\Node\Expr\StaticCall
|| $stmt instanceof PhpParser\Node\Expr\New_) {
|| $stmt instanceof PhpParser\Node\Expr\New_
) {
if ($stmt->isFirstClassCallable()) {
return [];
}

$yield_types = [];

foreach ($stmt->getArgs() as $arg) {
Expand Down

0 comments on commit 87160c8

Please sign in to comment.