@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | * @throws \InvalidArgumentException When the given color is not available. |
| 18 | 18 | * @return $this |
| 19 | 19 | */ |
| 20 | - public function setForeground(?string $color) : Style; |
|
| 20 | + public function setForeground(? string $color) : Style; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Sets the background color of this Style. |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @throws \InvalidArgumentException When the given color is not available. |
| 27 | 27 | * @return $this |
| 28 | 28 | */ |
| 29 | - public function setBackground(?string $color) : Style; |
|
| 29 | + public function setBackground(? string $color) : Style; |
|
| 30 | 30 | |
| 31 | 31 | /** |
| 32 | 32 | * Sets one or more emphasis option(s) for this Style. |
@@ -44,7 +44,6 @@ |
||
| 44 | 44 | * Sets the given Style in the Collection. |
| 45 | 45 | * |
| 46 | 46 | * @param string $name The name the Style should be set as. |
| 47 | - * @param mixed $value The Style to set. |
|
| 48 | 47 | * @return $this |
| 49 | 48 | */ |
| 50 | 49 | public function set(string $name, interfaces\Style $style) : Map |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param mixed $default The default value to return when the given Style does not exist in the Collection. |
| 36 | 36 | * @return interfaces\Style The Style or the default value given if the Style couldn't be found. |
| 37 | 37 | */ |
| 38 | - public function get(string $name, $default = null) : ?interfaces\Style |
|
| 38 | + public function get(string $name, $default = null) : ? interfaces\Style |
|
| 39 | 39 | { |
| 40 | 40 | return $this->items[strtolower($name)] ?? $default; |
| 41 | 41 | } |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @param interfaces\Style $style The Style to search for. |
| 110 | 110 | * @return string The name of the Style or null if it couldn't be found. |
| 111 | 111 | */ |
| 112 | - public function name(interfaces\Style $style) : ?string |
|
| 112 | + public function name(interfaces\Style $style) : ? string |
|
| 113 | 113 | { |
| 114 | 114 | foreach ($this->items as $key => $value) { |
| 115 | 115 | if ($value === $style) { |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | /** |
| 124 | 124 | * @see Map::get() |
| 125 | 125 | */ |
| 126 | - public function __get(string $name) : ?interfaces\Style |
|
| 126 | + public function __get(string $name) : ? interfaces\Style |
|
| 127 | 127 | { |
| 128 | 128 | return $this->get($name); |
| 129 | 129 | } |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | * Defaults to: ['foreground' => 'color', 'background' => 'bg']. |
| 85 | 85 | * @return Style The Style that was created based on it. |
| 86 | 86 | */ |
| 87 | - public static function fromString(string $string, array $properties = null) : ?Style |
|
| 87 | + public static function fromString(string $string, array $properties = null) : ? Style |
|
| 88 | 88 | { |
| 89 | 89 | if (!preg_match_all('/([^:]+):([^;]+)(;|$)/', strtolower($string), $matches, PREG_SET_ORDER)) { |
| 90 | 90 | return null; |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | * @param string $background The background color to be set. |
| 119 | 119 | * @param array $options An array of additional options emphasis to be set. |
| 120 | 120 | */ |
| 121 | - public function __construct(?string $foreground, string $background = null, array $options = null) |
|
| 121 | + public function __construct(? string $foreground, string $background = null, array $options = null) |
|
| 122 | 122 | { |
| 123 | 123 | if (isset($foreground)) { |
| 124 | 124 | $this->setForeground($foreground); |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | /** |
| 137 | 137 | * {@inheritDoc} |
| 138 | 138 | */ |
| 139 | - public function setForeground(?string $color) : interfaces\Style |
|
| 139 | + public function setForeground(? string $color) : interfaces\Style |
|
| 140 | 140 | { |
| 141 | 141 | return $this->setColor('foreground', $color); |
| 142 | 142 | } |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | /** |
| 145 | 145 | * {@inheritdoc} |
| 146 | 146 | */ |
| 147 | - public function setBackground(?string $color) : interfaces\Style |
|
| 147 | + public function setBackground(? string $color) : interfaces\Style |
|
| 148 | 148 | { |
| 149 | 149 | return $this->setColor('background', $color); |
| 150 | 150 | } |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | * @param string $color The color to set. |
| 207 | 207 | * @return $this |
| 208 | 208 | */ |
| 209 | - protected function setColor(string $type, ?string $color) : interfaces\Style |
|
| 209 | + protected function setColor(string $type, ? string $color) : interfaces\Style |
|
| 210 | 210 | { |
| 211 | 211 | if (isset($color) && !isset(static::${$type.'s'}[$color])) { |
| 212 | 212 | throw new \InvalidArgumentException("The $type color [$color] is not recognized."); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | * specific formats and therefore should not be kept within the Command class. |
| 118 | 118 | * |
| 119 | 119 | * @param Command $command The Command to provide the synopsis for. |
| 120 | - * @return mixed |
|
| 120 | + * @return string |
|
| 121 | 121 | */ |
| 122 | 122 | public function getCommandSynopsis(Command $command, array $options = null) |
| 123 | 123 | { |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | * |
| 142 | 142 | * @param definitions\Options $definitions The Input Option Definitions to provide a synopsis for. |
| 143 | 143 | * @param array $options Additional options to be considered by the Descriptor. |
| 144 | - * @return mixed |
|
| 144 | + * @return string |
|
| 145 | 145 | */ |
| 146 | 146 | public function getInputOptionsSynopsis(definitions\Options $definitions, array $options = null) |
| 147 | 147 | { |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | * |
| 170 | 170 | * @param input\Option $definition The Input Option to provide a synopsis for. |
| 171 | 171 | * @param array $options Additional options to be considered by the Descriptor. |
| 172 | - * @return mixed |
|
| 172 | + * @return string |
|
| 173 | 173 | */ |
| 174 | 174 | public function getInputOptionSynopsis(input\Option $definition, array $options = null) |
| 175 | 175 | { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * |
| 190 | 190 | * @param definitions\Arguments $definitions The Input Argument Definitions to provide a synopsis for. |
| 191 | 191 | * @param array $options Additional options to be considered by the Descriptor. |
| 192 | - * @return mixed |
|
| 192 | + * @return string |
|
| 193 | 193 | */ |
| 194 | 194 | public function getInputArgumentsSynopsis(definitions\Arguments $definitions, array $options = null) |
| 195 | 195 | { |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | * |
| 213 | 213 | * @param input\Argument $definition The Input Argument to provide a synopsis for. |
| 214 | 214 | * @param array $options Additional options to be considered by the Descriptor. |
| 215 | - * @return mixed |
|
| 215 | + * @return string |
|
| 216 | 216 | */ |
| 217 | 217 | public function getInputArgumentSynopsis(input\Argument $definition, array $options = null) |
| 218 | 218 | { |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | $output .= ' [--] '; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | - return $output . $this->getInputArgumentsSynopsis($inputArguments, $options); |
|
| 136 | + return $output.$this->getInputArgumentsSynopsis($inputArguments, $options); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /** |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | - return $out . $this->apply(substr($text, $offset), $decorated); |
|
| 101 | + return $out.$this->apply(substr($text, $offset), $decorated); |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | * @param bool $opening Whether it was an opening tag. |
| 146 | 146 | * @return interfaces\Style The Style matching the tag, if applicable. |
| 147 | 147 | */ |
| 148 | - protected function handleFormattingTag(string $tag, bool $opening) : ?interfaces\Style |
|
| 148 | + protected function handleFormattingTag(string $tag, bool $opening) : ? interfaces\Style |
|
| 149 | 149 | { |
| 150 | 150 | // First attempt to grab a Style matching the tag from our Collection. If none is found, |
| 151 | 151 | // see if it's an inline style. |