Total Complexity | 7 |
Total Lines | 65 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | trait ArgumentsTrait |
||
9 | { |
||
10 | |||
11 | /** |
||
12 | * @var Argument[] |
||
13 | */ |
||
14 | private $args = []; |
||
15 | |||
16 | /** |
||
17 | * @return bool |
||
18 | */ |
||
19 | public function hasArgs(): bool |
||
20 | { |
||
21 | return !empty($this->args); |
||
22 | } |
||
23 | |||
24 | /** |
||
25 | * @return Argument[] |
||
26 | */ |
||
27 | public function getArgs(): array |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @param Argument $arg |
||
34 | * @return $this |
||
35 | */ |
||
36 | protected function addArgument(Argument $arg) |
||
37 | { |
||
38 | $this->args[] = $arg; |
||
39 | |||
40 | return $this; |
||
41 | } |
||
42 | |||
43 | /** |
||
44 | * @param array $args |
||
45 | * @return $this |
||
46 | */ |
||
47 | protected function addArguments(array $args) |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @param Argument[] $args |
||
58 | * @return $this |
||
59 | * @throws \Exception |
||
60 | */ |
||
61 | protected function setArgs(array $args) |
||
73 | } |
||
74 | } |
||
75 |