1 | <?php |
||
15 | class Arguments |
||
16 | { |
||
17 | /** |
||
18 | * The arguments |
||
19 | * |
||
20 | * @var Argument[] |
||
21 | */ |
||
22 | protected $arguments; |
||
23 | |||
24 | /** |
||
25 | * Create process arguments object |
||
26 | */ |
||
27 | 27 | public function __construct() |
|
31 | |||
32 | /** |
||
33 | * Return process arguments as array |
||
34 | * |
||
35 | * @return array |
||
36 | */ |
||
37 | public function toArray() |
||
43 | |||
44 | /** |
||
45 | * Convert argument to process argument |
||
46 | * |
||
47 | * @param string|Argument $argument |
||
48 | * |
||
49 | * @throws \InvalidArgumentException |
||
50 | * |
||
51 | * @return Argument |
||
52 | */ |
||
53 | 24 | protected function convertArgument($argument) |
|
65 | |||
66 | /** |
||
67 | * Add process argument |
||
68 | * |
||
69 | * @param string|Argument $argument |
||
70 | * |
||
71 | * @throws \InvalidArgumentException |
||
72 | * |
||
73 | * @return $this |
||
74 | */ |
||
75 | 9 | public function addArgument($argument) |
|
81 | |||
82 | /** |
||
83 | * Add process arguments |
||
84 | * |
||
85 | * @param array $arguments |
||
86 | * |
||
87 | * @throws \InvalidArgumentException |
||
88 | * |
||
89 | * @return $this |
||
90 | */ |
||
91 | 9 | public function addArguments(array $arguments) |
|
99 | |||
100 | /** |
||
101 | * Hash the name |
||
102 | * |
||
103 | * @param string $name |
||
104 | * |
||
105 | * @return string |
||
106 | */ |
||
107 | 12 | protected function hashName($name) |
|
111 | |||
112 | /** |
||
113 | * Set process argument |
||
114 | * |
||
115 | * @param string|Argument $argument |
||
116 | * |
||
117 | * @throws \InvalidArgumentException |
||
118 | * |
||
119 | * @return $this |
||
120 | */ |
||
121 | 12 | public function setArgument($argument) |
|
130 | |||
131 | /** |
||
132 | * Set process arguments |
||
133 | * |
||
134 | * @param array $arguments |
||
135 | * |
||
136 | * @throws \InvalidArgumentException |
||
137 | * |
||
138 | * @return $this |
||
139 | */ |
||
140 | 9 | public function setArguments(array $arguments) |
|
148 | |||
149 | /** |
||
150 | * Get process argument |
||
151 | * |
||
152 | * @param string $name |
||
153 | * |
||
154 | * @return Argument|null |
||
155 | */ |
||
156 | 3 | public function getArgument($name) |
|
166 | } |
||
167 |