File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
rules/TypeDeclaration/TypeInferer Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -56,18 +56,16 @@ public function hasExclusiveVoid(ClassMethod | Closure | Function_ $functionLike
5656 return false ;
5757 }
5858
59- if ( $ this ->betterNodeFinder ->hasInstancesOfInFunctionLikeScoped (
59+ return ! ( bool ) $ this ->betterNodeFinder ->findFirstInFunctionLikeScoped (
6060 $ functionLike ,
61- [Yield_::class, YieldFrom::class]
62- ) ) {
63- return false ;
64- }
61+ function ( Node $ subNode ): bool {
62+ if ( $ subNode instanceof Yield_ || $ subNode instanceof YieldFrom ) {
63+ return true ;
64+ }
6565
66- $ return = $ this ->betterNodeFinder ->findFirstInFunctionLikeScoped (
67- $ functionLike ,
68- static fn (Node $ node ): bool => $ node instanceof Return_ && $ node ->expr instanceof Expr
66+ return $ subNode instanceof Return_ && $ subNode ->expr instanceof Expr;
67+ }
6968 );
70- return ! $ return instanceof Return_;
7169 }
7270
7371 public function hasSilentVoid (FunctionLike $ functionLike ): bool
You can’t perform that action at this time.
0 commit comments