rector/rules/Renaming/ValueObject/RenameProperty.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

45 lines
999 B
PHP

<?php
declare (strict_types=1);
namespace Rector\Renaming\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class RenameProperty
{
/**
* @readonly
* @var string
*/
private $type;
/**
* @readonly
* @var string
*/
private $oldProperty;
/**
* @readonly
* @var string
*/
private $newProperty;
public function __construct(string $type, string $oldProperty, string $newProperty)
{
$this->type = $type;
$this->oldProperty = $oldProperty;
$this->newProperty = $newProperty;
\Rector\Core\Validation\RectorAssert::className($type);
}
public function getObjectType() : \PHPStan\Type\ObjectType
{
return new \PHPStan\Type\ObjectType($this->type);
}
public function getOldProperty() : string
{
return $this->oldProperty;
}
public function getNewProperty() : string
{
return $this->newProperty;
}
}