comparison vendor/symfony/console/Input/Input.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
67 { 67 {
68 $definition = $this->definition; 68 $definition = $this->definition;
69 $givenArguments = $this->arguments; 69 $givenArguments = $this->arguments;
70 70
71 $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { 71 $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) {
72 return !array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); 72 return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired();
73 }); 73 });
74 74
75 if (\count($missingArguments) > 0) { 75 if (\count($missingArguments) > 0) {
76 throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); 76 throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments)));
77 } 77 }
148 { 148 {
149 if (!$this->definition->hasOption($name)) { 149 if (!$this->definition->hasOption($name)) {
150 throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); 150 throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name));
151 } 151 }
152 152
153 return array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); 153 return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault();
154 } 154 }
155 155
156 /** 156 /**
157 * {@inheritdoc} 157 * {@inheritdoc}
158 */ 158 */