Mercurial > hg > isophonics-drupal-site
comparison vendor/psy/psysh/src/Psy/Input/ShellInput.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
48 public function bind(InputDefinition $definition) | 48 public function bind(InputDefinition $definition) |
49 { | 49 { |
50 $hasCodeArgument = false; | 50 $hasCodeArgument = false; |
51 | 51 |
52 if ($definition->getArgumentCount() > 0) { | 52 if ($definition->getArgumentCount() > 0) { |
53 $args = $definition->getArguments(); | 53 $args = $definition->getArguments(); |
54 $lastArg = array_pop($args); | 54 $lastArg = array_pop($args); |
55 foreach ($args as $arg) { | 55 foreach ($args as $arg) { |
56 if ($arg instanceof CodeArgument) { | 56 if ($arg instanceof CodeArgument) { |
57 $msg = sprintf('Unexpected CodeArgument before the final position: %s', $arg->getName()); | 57 $msg = sprintf('Unexpected CodeArgument before the final position: %s', $arg->getName()); |
58 throw new \InvalidArgumentException($msg); | 58 throw new \InvalidArgumentException($msg); |
216 * @throws \RuntimeException When option given doesn't exist | 216 * @throws \RuntimeException When option given doesn't exist |
217 */ | 217 */ |
218 private function parseShortOptionSet($name) | 218 private function parseShortOptionSet($name) |
219 { | 219 { |
220 $len = strlen($name); | 220 $len = strlen($name); |
221 for ($i = 0; $i < $len; ++$i) { | 221 for ($i = 0; $i < $len; $i++) { |
222 if (!$this->definition->hasShortcut($name[$i])) { | 222 if (!$this->definition->hasShortcut($name[$i])) { |
223 throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); | 223 throw new \RuntimeException(sprintf('The "-%s" option does not exist.', $name[$i])); |
224 } | 224 } |
225 | 225 |
226 $option = $this->definition->getOptionForShortcut($name[$i]); | 226 $option = $this->definition->getOptionForShortcut($name[$i]); |