Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / console / Input / InputOption.php
index f08c5f26c104a493c263a358253ce5b6ef13f602..20c9d2ea5929b898a554da871a39417725e550c1 100644 (file)
@@ -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()