X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fconsole%2FInput%2FInputDefinition.php;h=19f8db33dac76adb2c457dd21947c84b0e4d751f;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=85b778b228627b19128705081cb9fa611ace39ba;hpb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;p=yaffs-website diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php index 85b778b22..19f8db33d 100644 --- a/vendor/symfony/console/Input/InputDefinition.php +++ b/vendor/symfony/console/Input/InputDefinition.php @@ -20,8 +20,8 @@ use Symfony\Component\Console\Exception\LogicException; * Usage: * * $definition = new InputDefinition(array( - * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), + * new InputArgument('name', InputArgument::REQUIRED), + * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), * )); * * @author Fabien Potencier @@ -36,8 +36,6 @@ class InputDefinition private $shortcuts; /** - * Constructor. - * * @param array $definition An array of InputArgument and InputOption instance */ public function __construct(array $definition = array()) @@ -47,8 +45,6 @@ class InputDefinition /** * Sets the definition of the input. - * - * @param array $definition The definition array */ public function setDefinition(array $definition) { @@ -95,10 +91,6 @@ class InputDefinition } /** - * Adds an InputArgument object. - * - * @param InputArgument $argument An InputArgument object - * * @throws LogicException When incorrect argument is given */ public function addArgument(InputArgument $argument) @@ -143,7 +135,7 @@ class InputDefinition throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); } - $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; + $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; return $arguments[$name]; } @@ -157,7 +149,7 @@ class InputDefinition */ public function hasArgument($name) { - $arguments = is_int($name) ? array_values($this->arguments) : $this->arguments; + $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; return isset($arguments[$name]); } @@ -179,7 +171,7 @@ class InputDefinition */ public function getArgumentCount() { - return $this->hasAnArrayArgument ? PHP_INT_MAX : count($this->arguments); + return $this->hasAnArrayArgument ? PHP_INT_MAX : \count($this->arguments); } /** @@ -232,10 +224,6 @@ class InputDefinition } /** - * Adds an InputOption object. - * - * @param InputOption $option An InputOption object - * * @throws LogicException When option given already exist */ public function addOption(InputOption $option) @@ -318,7 +306,7 @@ class InputDefinition /** * Gets an InputOption by shortcut. * - * @param string $shortcut the Shortcut name + * @param string $shortcut The Shortcut name * * @return InputOption An InputOption object */ @@ -390,7 +378,7 @@ class InputDefinition } } - if (count($elements) && $this->getArguments()) { + if (\count($elements) && $this->getArguments()) { $elements[] = '[--]'; } @@ -399,7 +387,7 @@ class InputDefinition if (!$argument->isRequired()) { $element = '['.$element.']'; } elseif ($argument->isArray()) { - $element = $element.' ('.$element.')'; + $element .= ' ('.$element.')'; } if ($argument->isArray()) {