rector/rules/Renaming/ValueObject/RenameClassAndConstFetch.php
Tomas Votruba cdc3b7adef Updated Rector to commit f451b0b8e1e6761ec7f50809745d44d01caba66d
f451b0b8e1 [PHP 8.0] Bump to promoted properties (#4)
2021-05-10 23:39:21 +00:00

50 lines
1.2 KiB
PHP

<?php
declare (strict_types=1);
namespace Rector\Renaming\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Renaming\Contract\RenameClassConstFetchInterface;
final class RenameClassAndConstFetch implements \Rector\Renaming\Contract\RenameClassConstFetchInterface
{
/**
* @var string
*/
private $oldClass;
/**
* @var string
*/
private $oldConstant;
/**
* @var string
*/
private $newClass;
/**
* @var string
*/
private $newConstant;
public function __construct(string $oldClass, string $oldConstant, string $newClass, string $newConstant)
{
$this->oldClass = $oldClass;
$this->oldConstant = $oldConstant;
$this->newClass = $newClass;
$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;
}
public function getNewClass() : string
{
return $this->newClass;
}
}