Skip to content

Commit

Permalink
Trigger Rectify (#4924)
Browse files Browse the repository at this point in the history
* Trigger Rectify

* [ci-review] Rector Rectify

* cs fix

---------

Co-authored-by: GitHub Action <actions@github.com>
  • Loading branch information
samsonasik and actions-user committed Sep 6, 2023
1 parent 15e9249 commit eca01b3
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions rules/TypeDeclaration/TypeInferer/SilentVoidResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
use Rector\Core\PhpParser\Node\BetterNodeFinder;
use Rector\Core\Reflection\ReflectionResolver;


final class SilentVoidResolver
{
public function __construct(
Expand All @@ -46,14 +45,11 @@ public function hasExclusiveVoid(ClassMethod | Closure | Function_ $functionLike
return false;
}

$return = $this->betterNodeFinder->findFirstInFunctionLikeScoped($functionLike, function(Node $node) {
if ($node instanceof Return_ && $node->expr instanceof Expr) {
return true;
}
return false;
});

return $return === null;
$return = $this->betterNodeFinder->findFirstInFunctionLikeScoped(
$functionLike,
static fn (Node $node): bool => $node instanceof Return_ && $node->expr instanceof Expr
);
return ! $return instanceof Return_;
}

public function hasSilentVoid(FunctionLike $functionLike): bool
Expand Down

0 comments on commit eca01b3

Please sign in to comment.