Skip to content

Commit

Permalink
Updated Rector to commit d2db35ef07cb9819544caec477d63c150e3e196c
Browse files Browse the repository at this point in the history
rectorphp/rector-src@d2db35e [Php80] Returns null on no change on ClassPropertyAssignToConstructorPromotionRector (#6418)
  • Loading branch information
TomasVotruba committed Nov 12, 2024
1 parent 715fc98 commit 5617a1e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ public function refactor(Node $node) : ?Node
if (!$classReflection instanceof ClassReflection) {
return null;
}
$hasChanged = \false;
foreach ($promotionCandidates as $promotionCandidate) {
$param = $promotionCandidate->getParam();
if ($this->shouldSkipParam($param)) {
Expand All @@ -200,6 +201,7 @@ public function refactor(Node $node) : ?Node
if (!$this->renameProperty && $paramName !== $propertyName) {
continue;
}
$hasChanged = \true;
// remove property from class
$propertyStmtKey = $property->getAttribute(AttributeKey::STMT_KEY);
unset($node->stmts[$propertyStmtKey]);
Expand Down Expand Up @@ -234,6 +236,9 @@ public function refactor(Node $node) : ?Node
return new PropertyFetch(new Variable('this'), $propertyName);
});
}
if (!$hasChanged) {
return null;
}
return $node;
}
public function provideMinPhpVersion() : int
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 = '0cac71a900cfa8d353231bc728e65d47b755b434';
public const PACKAGE_VERSION = 'd2db35ef07cb9819544caec477d63c150e3e196c';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-11-12 02:36:15';
public const RELEASE_DATE = '2024-11-12 10:23:38';
/**
* @var int
*/
Expand Down

0 comments on commit 5617a1e

Please sign in to comment.