Skip to content

Commit

Permalink
Updated Rector to commit 2846b015388fb1eb6d65941481fe9340908c1f79
Browse files Browse the repository at this point in the history
rectorphp/rector-src@2846b01 [CodeQuality] Skip combine var with property fetch on InlineArrayReturnAssignRector (#5681)
  • Loading branch information
TomasVotruba committed Mar 3, 2024
1 parent 659d1a4 commit c34bb45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function resolveFromStmtsAndVariable(array $stmts, Variable $variable) :
}
$assign = $stmtExpr;
$keyExpr = $this->matchKeyOnArrayDimFetchOfVariable($assign, $variable);
if ($keyExpr instanceof ArrayDimFetch) {
if ($assign->var instanceof ArrayDimFetch && $assign->var->var instanceof ArrayDimFetch) {
return [];
}
$keysAndExprs[] = new KeyAndExpr($keyExpr, $assign->expr, $stmt->getComments());
Expand All @@ -65,7 +65,7 @@ private function matchKeyOnArrayDimFetchOfVariable(Assign $assign, Variable $var
return null;
}
$arrayDimFetch = $assign->var;
if ($arrayDimFetch->var instanceof Variable && !$this->nodeComparator->areNodesEqual($arrayDimFetch->var, $variable)) {
if (!$this->nodeComparator->areNodesEqual($arrayDimFetch->var, $variable)) {
return null;
}
$isFoundInExpr = (bool) $this->betterNodeFinder->findFirst($assign->expr, function (Node $subNode) use($variable) : bool {
Expand All @@ -74,9 +74,6 @@ private function matchKeyOnArrayDimFetchOfVariable(Assign $assign, Variable $var
if ($isFoundInExpr) {
return null;
}
if ($arrayDimFetch->var instanceof ArrayDimFetch) {
return $arrayDimFetch->var;
}
return $arrayDimFetch->dim;
}
/**
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 = 'c591bd291650ab22554ffd819e76d01a1a405719';
public const PACKAGE_VERSION = '2846b015388fb1eb6d65941481fe9340908c1f79';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-03-03 09:07:19';
public const RELEASE_DATE = '2024-03-03 09:17:43';
/**
* @var int
*/
Expand Down

0 comments on commit c34bb45

Please sign in to comment.