@@ 144-158 (lines=15) @@ | ||
141 | return 0; |
|
142 | } |
|
143 | ||
144 | private function parseParams(Args $args, array &$parameters) |
|
145 | { |
|
146 | foreach ($args->getOption('param') as $parameter) { |
|
147 | $pos = strpos($parameter, '='); |
|
148 | ||
149 | if (false === $pos) { |
|
150 | throw new RuntimeException(sprintf( |
|
151 | 'Invalid parameter "%s". Expected "<name>=<value>".', |
|
152 | $parameter |
|
153 | )); |
|
154 | } |
|
155 | ||
156 | $parameters[substr($parameter, 0, $pos)] = StringUtil::parseValue(substr($parameter, $pos + 1)); |
|
157 | } |
|
158 | } |
|
159 | ||
160 | private function unsetParams(Args $args, array &$parameters) |
|
161 | { |
@@ 302-318 (lines=17) @@ | ||
299 | } |
|
300 | } |
|
301 | ||
302 | private function parseParamDescriptions(Args $args, array &$paramDescriptions) |
|
303 | { |
|
304 | foreach ($args->getOption('param-description') as $paramDescription) { |
|
305 | $pos = strpos($paramDescription, '='); |
|
306 | ||
307 | if (false === $pos) { |
|
308 | throw new RuntimeException(sprintf( |
|
309 | 'The "--param-description" option expects a parameter in '. |
|
310 | 'the form "key=value". Got: "%s"', |
|
311 | $paramDescription |
|
312 | )); |
|
313 | } |
|
314 | ||
315 | $key = substr($paramDescription, 0, $pos); |
|
316 | $paramDescriptions[$key] = StringUtil::parseValue(substr($paramDescription, $pos + 1)); |
|
317 | } |
|
318 | } |
|
319 | ||
320 | private function parseParams(Args $args, array &$bindingParams) |
|
321 | { |