forked from rectorphp/rector-src
-
Notifications
You must be signed in to change notification settings - Fork 0
/
NewToStaticCall.php
40 lines (32 loc) · 877 Bytes
/
NewToStaticCall.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
<?php
declare(strict_types=1);
namespace Rector\Transform\ValueObject;
use PHPStan\Type\ObjectType;
use Rector\Core\Validation\RectorAssert;
final class NewToStaticCall
{
/**
* @param class-string $staticCallClass
*/
public function __construct(
private readonly string $type,
private readonly string $staticCallClass,
private readonly string $staticCallMethod
) {
RectorAssert::className($type);
RectorAssert::className($staticCallClass);
RectorAssert::methodName($staticCallMethod);
}
public function getObjectType(): ObjectType
{
return new ObjectType($this->type);
}
public function getStaticCallClass(): string
{
return $this->staticCallClass;
}
public function getStaticCallMethod(): string
{
return $this->staticCallMethod;
}
}