@@ 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 | { |
@@ 308-324 (lines=17) @@ | ||
305 | } |
|
306 | } |
|
307 | ||
308 | private function parseParamDescriptions(Args $args, array &$paramDescriptions) |
|
309 | { |
|
310 | foreach ($args->getOption('param-description') as $paramDescription) { |
|
311 | $pos = strpos($paramDescription, '='); |
|
312 | ||
313 | if (false === $pos) { |
|
314 | throw new RuntimeException(sprintf( |
|
315 | 'The "--param-description" option expects a parameter in '. |
|
316 | 'the form "key=value". Got: "%s"', |
|
317 | $paramDescription |
|
318 | )); |
|
319 | } |
|
320 | ||
321 | $key = substr($paramDescription, 0, $pos); |
|
322 | $paramDescriptions[$key] = StringUtil::parseValue(substr($paramDescription, $pos + 1)); |
|
323 | } |
|
324 | } |
|
325 | ||
326 | private function parseParams(Args $args, array &$bindingParams) |
|
327 | { |