Skip to content

Commit

Permalink
Updated Rector to commit c5940d2cc1adbe39945e0a0f9029823a883671e6
Browse files Browse the repository at this point in the history
rectorphp/rector-src@c5940d2 [TypeDeclaration] Reduce double traverse on StrictReturnNewAnalyzer ReturnTypeFromStrictNewArrayRector (#6321)
  • Loading branch information
TomasVotruba committed Sep 21, 2024
1 parent ebc5937 commit 426bac9
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\New_;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Expr\Yield_;
use PhpParser\Node\Expr\YieldFrom;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\ClassMethod;
use PhpParser\Node\Stmt\Expression;
Expand Down Expand Up @@ -56,9 +54,6 @@ public function matchAlwaysReturnVariableNew($functionLike) : ?string
if ($functionLike->stmts === null) {
return null;
}
if ($this->betterNodeFinder->hasInstancesOfInFunctionLikeScoped($functionLike, [Yield_::class, YieldFrom::class])) {
return null;
}
$returns = $this->betterNodeFinder->findReturnsScoped($functionLike);
if (!$this->returnAnalyzer->hasOnlyReturnWithExpr($functionLike, $returns)) {
return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use PhpParser\Node\Expr\Assign;
use PhpParser\Node\Expr\Closure;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Expr\Yield_;
use PhpParser\Node\Expr\YieldFrom;
use PhpParser\Node\Identifier;
use PhpParser\Node\Stmt;
use PhpParser\Node\Stmt\ClassMethod;
Expand Down Expand Up @@ -127,10 +125,6 @@ public function refactorWithScope(Node $node, Scope $scope) : ?Node
if ($variables === []) {
return null;
}
// 2. skip yields
if ($this->betterNodeFinder->hasInstancesOfInFunctionLikeScoped($node, [Yield_::class, YieldFrom::class])) {
return null;
}
$returns = $this->betterNodeFinder->findReturnsScoped($node);
if (!$this->returnAnalyzer->hasOnlyReturnWithExpr($node, $returns)) {
return null;
Expand Down
4 changes: 2 additions & 2 deletions src/Application/VersionResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '92f64ffc17e7ad969edf8e48cf02ba68f72b2efc';
public const PACKAGE_VERSION = 'c5940d2cc1adbe39945e0a0f9029823a883671e6';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-09-21 20:07:30';
public const RELEASE_DATE = '2024-09-21 21:30:28';
/**
* @var int
*/
Expand Down

0 comments on commit 426bac9

Please sign in to comment.