-
-
Notifications
You must be signed in to change notification settings - Fork 333
/
ArgumentAdder.php
65 lines (54 loc) · 1.33 KB
/
ArgumentAdder.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
declare(strict_types=1);
namespace Rector\Arguments\ValueObject;
use PHPStan\Type\ObjectType;
use PHPStan\Type\Type;
use Rector\Core\Validation\RectorAssert;
final class ArgumentAdder
{
/**
* @param mixed|null $argumentDefaultValue
*/
public function __construct(
private readonly string $class,
private readonly string $method,
private readonly int $position,
private readonly ?string $argumentName = null,
private $argumentDefaultValue = null,
private readonly Type | null $argumentType = null,
private readonly ?string $scope = null
) {
RectorAssert::className($class);
}
public function getObjectType(): ObjectType
{
return new ObjectType($this->class);
}
public function getMethod(): string
{
return $this->method;
}
public function getPosition(): int
{
return $this->position;
}
public function getArgumentName(): ?string
{
return $this->argumentName;
}
/**
* @return mixed|null
*/
public function getArgumentDefaultValue()
{
return $this->argumentDefaultValue;
}
public function getArgumentType(): ?Type
{
return $this->argumentType;
}
public function getScope(): ?string
{
return $this->scope;
}
}