Skip to content

Commit

Permalink
Updated Rector to commit 1ebb7aa29bfff54059d455ee6f908fa47a7416c3
Browse files Browse the repository at this point in the history
rectorphp/rector-src@1ebb7aa [CodeQuality] Allow transform static to self on final class on ConvertStaticPrivateConstantToSelfRector (#6295)
  • Loading branch information
TomasVotruba committed Sep 8, 2024
1 parent 09d8db0 commit 7d52cf2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ public function refactor(Node $node) : ?Class_
if (!$node instanceof ClassConstFetch) {
return null;
}
if ($this->shouldBeSkipped($class, $node)) {
if (!$this->isUsingStatic($node)) {
return null;
}
if (!$class->isFinal() && !$this->isPrivateConstant($node, $class)) {
return null;
}
$hasChanged = \true;
Expand Down Expand Up @@ -96,13 +99,6 @@ private function isPrivateConstant(ClassConstFetch $classConstFetch, Class_ $cla
}
return \false;
}
private function shouldBeSkipped(Class_ $class, ClassConstFetch $classConstFetch) : bool
{
if (!$this->isUsingStatic($classConstFetch)) {
return \true;
}
return !$this->isPrivateConstant($classConstFetch, $class);
}
private function getConstantName(ClassConstFetch $classConstFetch) : ?string
{
$constantNameIdentifier = $classConstFetch->name;
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 = '393423fd3c87f1e915f252f8316f1616b623c320';
public const PACKAGE_VERSION = '1ebb7aa29bfff54059d455ee6f908fa47a7416c3';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-09-08 01:36:56';
public const RELEASE_DATE = '2024-09-08 17:51:18';
/**
* @var int
*/
Expand Down

0 comments on commit 7d52cf2

Please sign in to comment.