2020-08-26 12:54:53 +02:00
|
|
|
<?php
|
|
|
|
|
2021-05-09 20:15:43 +00:00
|
|
|
declare (strict_types=1);
|
2020-09-27 23:33:32 +02:00
|
|
|
namespace Rector\Renaming\ValueObject;
|
2020-08-26 12:54:53 +02:00
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
use PHPStan\Type\ObjectType;
|
2020-09-12 23:19:08 +02:00
|
|
|
final class RenameProperty
|
2020-08-26 12:54:53 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $type;
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $oldProperty;
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $newProperty;
|
|
|
|
public function __construct(string $type, string $oldProperty, string $newProperty)
|
|
|
|
{
|
|
|
|
$this->type = $type;
|
|
|
|
$this->oldProperty = $oldProperty;
|
|
|
|
$this->newProperty = $newProperty;
|
|
|
|
}
|
2021-05-10 22:23:08 +00:00
|
|
|
public function getObjectType() : \PHPStan\Type\ObjectType
|
2020-08-26 12:54:53 +02:00
|
|
|
{
|
2021-05-10 22:23:08 +00:00
|
|
|
return new \PHPStan\Type\ObjectType($this->type);
|
2020-08-26 12:54:53 +02:00
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getOldProperty() : string
|
2020-08-26 12:54:53 +02:00
|
|
|
{
|
|
|
|
return $this->oldProperty;
|
|
|
|
}
|
2021-05-09 20:15:43 +00:00
|
|
|
public function getNewProperty() : string
|
2020-08-26 12:54:53 +02:00
|
|
|
{
|
|
|
|
return $this->newProperty;
|
|
|
|
}
|
|
|
|
}
|