1 | <?php namespace nyx\console\input\parameter\values; |
||
18 | class Arguments extends parameter\Values |
||
19 | { |
||
20 | /** |
||
21 | * @var parameter\definitions\Arguments The Definitions of the Arguments that can be present in this collection. |
||
22 | */ |
||
23 | protected $definitions; |
||
24 | |||
25 | /** |
||
26 | * {@inheritdoc} |
||
27 | * |
||
28 | * Overridden to enforce a stricter Definitions collection type. |
||
29 | */ |
||
30 | public function __construct(parameter\definitions\Arguments $definition) |
||
34 | |||
35 | /** |
||
36 | * Adds an argument's value to the collection. |
||
37 | * |
||
38 | * Automatically decides on the name of the argument based on the present definition. |
||
39 | * |
||
40 | * @param string $value The argument's value to set. |
||
41 | * @param $this |
||
42 | * @throws exceptions\ArgumentsTooMany When the definition does not permit any further arguments. |
||
43 | */ |
||
44 | public function push(string $value) : core\collections\interfaces\Map |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | * |
||
60 | * Overridden to include validation in the finalize step, while ensuring the Collection is valid |
||
61 | * already before being populated with default values for not explicitly set Arguments. |
||
62 | */ |
||
63 | public function finalize() : parameter\Values |
||
69 | |||
70 | /** |
||
71 | * Validates this collection. |
||
72 | * |
||
73 | * Checks if the Collection contains all necessary arguments. We are not validating whether there are |
||
74 | * too many arguments as this can only happen when push()'ing values directly, which is handled inside |
||
75 | * that method as well. |
||
76 | * |
||
77 | * @throws exceptions\ArgumentsNotEnough When not enough arguments are present in this Collection. |
||
78 | */ |
||
79 | protected function validate() |
||
85 | } |
||
86 |