mirror of
https://github.com/rectorphp/rector.git
synced 2025-02-13 12:33:52 +01:00
60 lines
1.1 KiB
PHP
60 lines
1.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Rector\Renaming\ValueObject;
|
|
|
|
use PHPStan\Type\ObjectType;
|
|
use Rector\Renaming\Contract\RenameClassConstFetchInterface;
|
|
|
|
final class RenameClassAndConstFetch implements RenameClassConstFetchInterface
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $oldClass;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $oldConstant;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $newConstant;
|
|
|
|
/**
|
|
* @var string
|
|
*/
|
|
private $newClass;
|
|
|
|
public function __construct(string $oldClass, string $oldConstant, string $newClass, string $newConstant)
|
|
{
|
|
$this->oldClass = $oldClass;
|
|
$this->oldConstant = $oldConstant;
|
|
$this->newConstant = $newConstant;
|
|
$this->newClass = $newClass;
|
|
}
|
|
|
|
public function getOldObjectType(): ObjectType
|
|
{
|
|
return new ObjectType($this->oldClass);
|
|
}
|
|
|
|
public function getOldConstant(): string
|
|
{
|
|
return $this->oldConstant;
|
|
}
|
|
|
|
public function getNewConstant(): string
|
|
{
|
|
return $this->newConstant;
|
|
}
|
|
|
|
public function getNewClass(): string
|
|
{
|
|
return $this->newClass;
|
|
}
|
|
}
|