Skip to content

Commit d785659

Browse files
janedbalondrejmirtes
authored andcommitted
Add ReturnStatementsNode::hasNativeReturnTypehint
1 parent 46c970f commit d785659

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Node/ClosureReturnStatementsNode.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public function getClosureExpr(): Closure
3535
return $this->closureExpr;
3636
}
3737

38+
public function hasNativeReturnTypehint(): bool
39+
{
40+
return $this->closureExpr->returnType !== null;
41+
}
42+
3843
/**
3944
* @return ReturnStatement[]
4045
*/

src/Node/ReturnStatementsNode.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ public function getStatementResult(): StatementResult;
1717

1818
public function returnsByRef(): bool;
1919

20+
public function hasNativeReturnTypehint(): bool;
21+
2022
}

0 commit comments

Comments
 (0)