Total Complexity | 7 |
Total Lines | 35 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
16 | final class Argument |
||
17 | { |
||
18 | public function __construct( |
||
19 | private string $name, |
||
20 | private array $rootValues, |
||
21 | private \ReflectionType $type, |
||
22 | ) { |
||
23 | } |
||
24 | |||
25 | public function getRootValues(): array |
||
26 | { |
||
27 | return $this->rootValues; |
||
28 | } |
||
29 | |||
30 | public function getName(): string |
||
31 | { |
||
32 | return $this->name; |
||
33 | } |
||
34 | |||
35 | public function getType(): \ReflectionType |
||
36 | { |
||
37 | return $this->type; |
||
38 | } |
||
39 | |||
40 | public function getValueByArgumentName(): mixed |
||
41 | { |
||
42 | return array_key_exists($this->name, $this->rootValues) ? $this->rootValues[$this->name] : null; |
||
43 | } |
||
44 | |||
45 | public function withType(\ReflectionType $type): self |
||
51 | } |
||
52 | } |
||
53 |