Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/console/Input/Input.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
27 */ | 27 */ |
28 abstract class Input implements InputInterface, StreamableInputInterface | 28 abstract class Input implements InputInterface, StreamableInputInterface |
29 { | 29 { |
30 protected $definition; | 30 protected $definition; |
31 protected $stream; | 31 protected $stream; |
32 protected $options = array(); | 32 protected $options = []; |
33 protected $arguments = array(); | 33 protected $arguments = []; |
34 protected $interactive = true; | 34 protected $interactive = true; |
35 | 35 |
36 public function __construct(InputDefinition $definition = null) | 36 public function __construct(InputDefinition $definition = null) |
37 { | 37 { |
38 if (null === $definition) { | 38 if (null === $definition) { |
46 /** | 46 /** |
47 * {@inheritdoc} | 47 * {@inheritdoc} |
48 */ | 48 */ |
49 public function bind(InputDefinition $definition) | 49 public function bind(InputDefinition $definition) |
50 { | 50 { |
51 $this->arguments = array(); | 51 $this->arguments = []; |
52 $this->options = array(); | 52 $this->options = []; |
53 $this->definition = $definition; | 53 $this->definition = $definition; |
54 | 54 |
55 $this->parse(); | 55 $this->parse(); |
56 } | 56 } |
57 | 57 |
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 } |
78 } | 78 } |
79 | 79 |
80 /** | 80 /** |