mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-19 06:18:07 +01:00
misc
This commit is contained in:
parent
748e8218fe
commit
3611715075
@ -22,7 +22,7 @@ abstract class AbstractChangeParentClassRector extends AbstractRector
|
||||
*/
|
||||
public function refactor(Node $node): ?Node
|
||||
{
|
||||
$node->extends = new Name('\\' . $this->getNewClassName());
|
||||
$node->extends = new Name\FullyQualified($this->getNewClassName());
|
||||
|
||||
return $node;
|
||||
}
|
||||
|
@ -12,21 +12,17 @@ final class RemoveConfiguratorConstantsRector extends AbstractRector
|
||||
{
|
||||
public function isCandidate(Node $node): bool
|
||||
{
|
||||
if ($node instanceof ClassConstFetch) {
|
||||
if (! $node instanceof ClassConstFetch) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$className = $this->getClassNameFromClassConstFetch($node);
|
||||
|
||||
if ($className !== $this->getDesiredClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (! in_array((string) $node->name, ['DEVELOPMENT', 'PRODUCTION'], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
return in_array((string) $node->name, ['DEVELOPMENT', 'PRODUCTION'], true);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -35,9 +31,10 @@ final class RemoveConfiguratorConstantsRector extends AbstractRector
|
||||
public function refactor(Node $classConstFetchNode): ?Node
|
||||
{
|
||||
$constantName = (string) $classConstFetchNode->name;
|
||||
$string = strtolower($constantName);
|
||||
|
||||
return new String_($string);
|
||||
$originalConstantValue = strtolower($constantName);
|
||||
|
||||
return new String_($originalConstantValue);
|
||||
}
|
||||
|
||||
public function getSetName(): string
|
||||
|
Loading…
x
Reference in New Issue
Block a user