2020-08-25 00:26:14 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Rector\Renaming\ValueObject;
|
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
use PHPStan\Type\ObjectType;
|
2020-08-25 00:26:14 +02:00
|
|
|
use Rector\Renaming\Contract\MethodCallRenameInterface;
|
|
|
|
|
|
|
|
final class MethodCallRename implements MethodCallRenameInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $oldClass;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $oldMethod;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $newMethod;
|
|
|
|
|
|
|
|
public function __construct(string $oldClass, string $oldMethod, string $newMethod)
|
|
|
|
{
|
|
|
|
$this->oldClass = $oldClass;
|
|
|
|
$this->oldMethod = $oldMethod;
|
|
|
|
$this->newMethod = $newMethod;
|
|
|
|
}
|
|
|
|
|
2021-02-27 03:13:22 +01:00
|
|
|
public function getOldObjectType(): ObjectType
|
2020-08-25 00:26:14 +02:00
|
|
|
{
|
2021-02-27 03:13:22 +01:00
|
|
|
return new ObjectType($this->oldClass);
|
2020-08-25 00:26:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function getOldMethod(): string
|
|
|
|
{
|
|
|
|
return $this->oldMethod;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getNewMethod(): string
|
|
|
|
{
|
|
|
|
return $this->newMethod;
|
|
|
|
}
|
|
|
|
}
|