X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;f=vendor%2Fsymfony%2Fconsole%2FInput%2FInputOption.php;h=20c9d2ea5929b898a554da871a39417725e550c1;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=f08c5f26c104a493c263a358253ce5b6ef13f602;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php index f08c5f26c..20c9d2ea5 100644 --- a/vendor/symfony/console/Input/InputOption.php +++ b/vendor/symfony/console/Input/InputOption.php @@ -33,13 +33,11 @@ class InputOption private $description; /** - * Constructor. - * - * @param string $name The option name - * @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int $mode The option mode: One of the VALUE_* constants - * @param string $description A description text - * @param mixed $default The default value (must be null for self::VALUE_NONE) + * @param string $name The option name + * @param string|array $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts + * @param int|null $mode The option mode: One of the VALUE_* constants + * @param string $description A description text + * @param string|string[]|int|bool|null $default The default value (must be null for self::VALUE_NONE) * * @throws InvalidArgumentException If option mode is invalid or incompatible */ @@ -58,7 +56,7 @@ class InputOption } if (null !== $shortcut) { - if (is_array($shortcut)) { + if (\is_array($shortcut)) { $shortcut = implode('|', $shortcut); } $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); @@ -72,7 +70,7 @@ class InputOption if (null === $mode) { $mode = self::VALUE_NONE; - } elseif (!is_int($mode) || $mode > 15 || $mode < 1) { + } elseif (!\is_int($mode) || $mode > 15 || $mode < 1) { throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); } @@ -151,7 +149,7 @@ class InputOption /** * Sets the default value. * - * @param mixed $default The default value + * @param string|string[]|int|bool|null $default The default value * * @throws LogicException When incorrect default value is given */ @@ -164,7 +162,7 @@ class InputOption if ($this->isArray()) { if (null === $default) { $default = array(); - } elseif (!is_array($default)) { + } elseif (!\is_array($default)) { throw new LogicException('A default value for an array option must be an array.'); } } @@ -175,7 +173,7 @@ class InputOption /** * Returns the default value. * - * @return mixed The default value + * @return string|string[]|int|bool|null The default value */ public function getDefault() { @@ -195,11 +193,9 @@ class InputOption /** * Checks whether the given option equals this one. * - * @param InputOption $option option to compare - * * @return bool */ - public function equals(InputOption $option) + public function equals(self $option) { return $option->getName() === $this->getName() && $option->getShortcut() === $this->getShortcut()