-
-
Notifications
You must be signed in to change notification settings - Fork 336
/
MethodCallRename.php
42 lines (34 loc) · 942 Bytes
/
MethodCallRename.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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 MethodCallRenameInterface
{
public function __construct(
private readonly string $class,
private readonly string $oldMethod,
private readonly string $newMethod
) {
RectorAssert::className($class);
RectorAssert::methodName($oldMethod);
RectorAssert::methodName($newMethod);
}
public function getClass(): string
{
return $this->class;
}
public function getObjectType(): ObjectType
{
return new ObjectType($this->class);
}
public function getOldMethod(): string
{
return $this->oldMethod;
}
public function getNewMethod(): string
{
return $this->newMethod;
}
}