rector/rules/Renaming/ValueObject/RenameClassConstFetch.php
Tomas Votruba c726969380 Updated Rector to commit fc10fce13dcf9767f54e4202b509020fed338645
fc10fce13d [Rectify] [Php81] Enable Rectify on Readonly Property only (#1384)
2021-12-04 12:47:17 +00:00

44 lines
1.0 KiB
PHP

<?php
declare (strict_types=1);
namespace Rector\Renaming\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Renaming\Contract\RenameClassConstFetchInterface;
final class RenameClassConstFetch implements \Rector\Renaming\Contract\RenameClassConstFetchInterface
{
/**
* @readonly
* @var string
*/
private $oldClass;
/**
* @readonly
* @var string
*/
private $oldConstant;
/**
* @readonly
* @var string
*/
private $newConstant;
public function __construct(string $oldClass, string $oldConstant, string $newConstant)
{
$this->oldClass = $oldClass;
$this->oldConstant = $oldConstant;
$this->newConstant = $newConstant;
}
public function getOldObjectType() : \PHPStan\Type\ObjectType
{
return new \PHPStan\Type\ObjectType($this->oldClass);
}
public function getOldConstant() : string
{
return $this->oldConstant;
}
public function getNewConstant() : string
{
return $this->newConstant;
}
}