comparison vendor/symfony/console/Input/InputDefinition.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
34 private $hasOptional; 34 private $hasOptional;
35 private $options; 35 private $options;
36 private $shortcuts; 36 private $shortcuts;
37 37
38 /** 38 /**
39 * Constructor.
40 *
41 * @param array $definition An array of InputArgument and InputOption instance 39 * @param array $definition An array of InputArgument and InputOption instance
42 */ 40 */
43 public function __construct(array $definition = array()) 41 public function __construct(array $definition = array())
44 { 42 {
45 $this->setDefinition($definition); 43 $this->setDefinition($definition);
46 } 44 }
47 45
48 /** 46 /**
49 * Sets the definition of the input. 47 * Sets the definition of the input.
50 *
51 * @param array $definition The definition array
52 */ 48 */
53 public function setDefinition(array $definition) 49 public function setDefinition(array $definition)
54 { 50 {
55 $arguments = array(); 51 $arguments = array();
56 $options = array(); 52 $options = array();
93 } 89 }
94 } 90 }
95 } 91 }
96 92
97 /** 93 /**
98 * Adds an InputArgument object.
99 *
100 * @param InputArgument $argument An InputArgument object
101 *
102 * @throws LogicException When incorrect argument is given 94 * @throws LogicException When incorrect argument is given
103 */ 95 */
104 public function addArgument(InputArgument $argument) 96 public function addArgument(InputArgument $argument)
105 { 97 {
106 if (isset($this->arguments[$argument->getName()])) { 98 if (isset($this->arguments[$argument->getName()])) {
230 $this->addOption($option); 222 $this->addOption($option);
231 } 223 }
232 } 224 }
233 225
234 /** 226 /**
235 * Adds an InputOption object.
236 *
237 * @param InputOption $option An InputOption object
238 *
239 * @throws LogicException When option given already exist 227 * @throws LogicException When option given already exist
240 */ 228 */
241 public function addOption(InputOption $option) 229 public function addOption(InputOption $option)
242 { 230 {
243 if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { 231 if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) {
316 } 304 }
317 305
318 /** 306 /**
319 * Gets an InputOption by shortcut. 307 * Gets an InputOption by shortcut.
320 * 308 *
321 * @param string $shortcut the Shortcut name 309 * @param string $shortcut The Shortcut name
322 * 310 *
323 * @return InputOption An InputOption object 311 * @return InputOption An InputOption object
324 */ 312 */
325 public function getOptionForShortcut($shortcut) 313 public function getOptionForShortcut($shortcut)
326 { 314 {