forked from rectorphp/rector-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MethodCallToStaticCall.php
48 lines (39 loc) · 1.03 KB
/
MethodCallToStaticCall.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
43
44
45
46
47
48
<?php
declare(strict_types=1);
namespace Rector\Transform\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class MethodCallToStaticCall
{
/**
* @param class-string $oldClass
* @param class-string $newClass
*/
public function __construct(
private readonly string $oldClass,
private readonly string $oldMethod,
private readonly string $newClass,
private readonly string $newMethod
) {
RectorAssert::className($oldClass);
RectorAssert::className($oldMethod);
RectorAssert::className($newClass);
RectorAssert::className($newMethod);
}
public function getOldObjectType(): ObjectType
{
return new ObjectType($this->oldClass);
}
public function getOldMethod(): string
{
return $this->oldMethod;
}
public function getNewClass(): string
{
return $this->newClass;
}
public function getNewMethod(): string
{
return $this->newMethod;
}
}