Skip to content

Commit

Permalink
Add ReturnStatementsNode::hasNativeReturnTypehint
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal authored and ondrejmirtes committed Dec 30, 2022
1 parent 46c970f commit d785659
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Node/ClosureReturnStatementsNode.php
Expand Up @@ -35,6 +35,11 @@ public function getClosureExpr(): Closure
return $this->closureExpr;
}

public function hasNativeReturnTypehint(): bool
{
return $this->closureExpr->returnType !== null;
}

/**
* @return ReturnStatement[]
*/
Expand Down
2 changes: 2 additions & 0 deletions src/Node/ReturnStatementsNode.php
Expand Up @@ -17,4 +17,6 @@ public function getStatementResult(): StatementResult;

public function returnsByRef(): bool;

public function hasNativeReturnTypehint(): bool;

}

0 comments on commit d785659

Please sign in to comment.