1 | <?php |
||
12 | trait AstArgumentsTrait |
||
13 | { |
||
14 | |||
15 | /** @var Argument[] */ |
||
16 | protected $arguments; |
||
17 | |||
18 | private $argumentsCache = null; |
||
19 | |||
20 | |||
21 | 3 | public function hasArguments() |
|
25 | |||
26 | public function hasArgument($name) |
||
30 | |||
31 | /** |
||
32 | * @return Argument[] |
||
33 | */ |
||
34 | 70 | public function getArguments() |
|
38 | |||
39 | /** |
||
40 | * @param $name |
||
41 | * |
||
42 | * @return null|Argument |
||
43 | */ |
||
44 | 1 | public function getArgument($name) |
|
45 | { |
||
46 | 1 | $argument = null; |
|
47 | 1 | if (isset($this->arguments[$name])) { |
|
48 | 1 | $argument = $this->arguments[$name]; |
|
49 | 1 | } |
|
50 | |||
51 | 1 | return $argument; |
|
52 | } |
||
53 | |||
54 | 1 | public function getArgumentValue($name) |
|
60 | |||
61 | /** |
||
62 | * @param $arguments Argument[] |
||
63 | */ |
||
64 | 99 | public function setArguments(array $arguments) |
|
65 | { |
||
66 | 99 | $this->arguments = []; |
|
67 | 99 | $this->argumentsCache = null; |
|
68 | |||
69 | 99 | foreach ($arguments as $argument) { |
|
70 | 54 | $this->addArgument($argument); |
|
71 | 99 | } |
|
72 | 99 | } |
|
73 | |||
74 | 55 | public function addArgument(Argument $argument) |
|
78 | |||
79 | 4 | public function getKeyValueArguments() |
|
80 | { |
||
93 | } |