Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / symfony / console / Formatter / OutputFormatterStyle.php
index 7ada54f4c11b93bcd09a4eb2825e370b53a4a8d0..b884d71343804c20ae5d8afddd9fe459437e8916 100644 (file)
@@ -69,7 +69,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
         if (null !== $background) {
             $this->setBackground($background);
         }
-        if (count($options)) {
+        if (\count($options)) {
             $this->setOptions($options);
         }
     }
@@ -90,11 +90,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
         }
 
         if (!isset(static::$availableForegroundColors[$color])) {
-            throw new InvalidArgumentException(sprintf(
-                'Invalid foreground color specified: "%s". Expected one of (%s)',
-                $color,
-                implode(', ', array_keys(static::$availableForegroundColors))
-            ));
+            throw new InvalidArgumentException(sprintf('Invalid foreground color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableForegroundColors))));
         }
 
         $this->foreground = static::$availableForegroundColors[$color];
@@ -116,11 +112,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
         }
 
         if (!isset(static::$availableBackgroundColors[$color])) {
-            throw new InvalidArgumentException(sprintf(
-                'Invalid background color specified: "%s". Expected one of (%s)',
-                $color,
-                implode(', ', array_keys(static::$availableBackgroundColors))
-            ));
+            throw new InvalidArgumentException(sprintf('Invalid background color specified: "%s". Expected one of (%s)', $color, implode(', ', array_keys(static::$availableBackgroundColors))));
         }
 
         $this->background = static::$availableBackgroundColors[$color];
@@ -136,14 +128,10 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
     public function setOption($option)
     {
         if (!isset(static::$availableOptions[$option])) {
-            throw new InvalidArgumentException(sprintf(
-                'Invalid option specified: "%s". Expected one of (%s)',
-                $option,
-                implode(', ', array_keys(static::$availableOptions))
-            ));
+            throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
         }
 
-        if (!in_array(static::$availableOptions[$option], $this->options)) {
+        if (!\in_array(static::$availableOptions[$option], $this->options)) {
             $this->options[] = static::$availableOptions[$option];
         }
     }
@@ -158,11 +146,7 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
     public function unsetOption($option)
     {
         if (!isset(static::$availableOptions[$option])) {
-            throw new InvalidArgumentException(sprintf(
-                'Invalid option specified: "%s". Expected one of (%s)',
-                $option,
-                implode(', ', array_keys(static::$availableOptions))
-            ));
+            throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s)', $option, implode(', ', array_keys(static::$availableOptions))));
         }
 
         $pos = array_search(static::$availableOptions[$option], $this->options);
@@ -203,14 +187,14 @@ class OutputFormatterStyle implements OutputFormatterStyleInterface
             $setCodes[] = $this->background['set'];
             $unsetCodes[] = $this->background['unset'];
         }
-        if (count($this->options)) {
+        if (\count($this->options)) {
             foreach ($this->options as $option) {
                 $setCodes[] = $option['set'];
                 $unsetCodes[] = $option['unset'];
             }
         }
 
-        if (0 === count($setCodes)) {
+        if (0 === \count($setCodes)) {
             return $text;
         }