rector/rules/Renaming/ValueObject/MethodCallRename.php
Tomas Votruba 7e46eb8267 Updated Rector to commit a2d6da8b4e5f3058dd95b4db2d173682b250896e
a2d6da8b4e Back to php-scoper 0.14 with scoping from php 8.0 (#2370)
2022-05-27 11:51:31 +00:00

50 lines
1.2 KiB
PHP

<?php
declare (strict_types=1);
namespace Rector\Renaming\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
use Rector\Renaming\Contract\MethodCallRenameInterface;
final class MethodCallRename implements \Rector\Renaming\Contract\MethodCallRenameInterface
{
/**
* @readonly
* @var string
*/
private $class;
/**
* @readonly
* @var string
*/
private $oldMethod;
/**
* @readonly
* @var string
*/
private $newMethod;
public function __construct(string $class, string $oldMethod, string $newMethod)
{
$this->class = $class;
$this->oldMethod = $oldMethod;
$this->newMethod = $newMethod;
\Rector\Core\Validation\RectorAssert::className($class);
}
public function getClass() : string
{
return $this->class;
}
public function getObjectType() : \PHPStan\Type\ObjectType
{
return new \PHPStan\Type\ObjectType($this->class);
}
public function getOldMethod() : string
{
return $this->oldMethod;
}
public function getNewMethod() : string
{
return $this->newMethod;
}
}