@@ -17,7 +17,7 @@ |
||
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * File constructor. |
| 20 | - * @param array $value |
|
| 20 | + * @param string $value |
|
| 21 | 21 | * @param bool $mustExist |
| 22 | 22 | * @param int $timeout |
| 23 | 23 | */ |
@@ -17,15 +17,15 @@ |
||
| 17 | 17 | $hex = str_replace("#", "", $this->value); |
| 18 | 18 | |
| 19 | 19 | if (strlen($hex) == 3) { |
| 20 | - $red = hexdec($hex[0].$hex[0]); |
|
| 21 | - $green = hexdec($hex[1].$hex[1]); |
|
| 22 | - $blue = hexdec($hex[2].$hex[2]); |
|
| 20 | + $red = hexdec($hex[ 0 ].$hex[ 0 ]); |
|
| 21 | + $green = hexdec($hex[ 1 ].$hex[ 1 ]); |
|
| 22 | + $blue = hexdec($hex[ 2 ].$hex[ 2 ]); |
|
| 23 | 23 | } else { |
| 24 | - $red = hexdec($hex[0].$hex[1]); |
|
| 25 | - $green = hexdec($hex[2].$hex[3]); |
|
| 26 | - $blue = hexdec($hex[4].$hex[5]); |
|
| 24 | + $red = hexdec($hex[ 0 ].$hex[ 1 ]); |
|
| 25 | + $green = hexdec($hex[ 2 ].$hex[ 3 ]); |
|
| 26 | + $blue = hexdec($hex[ 4 ].$hex[ 5 ]); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - return new Rgb([$red, $green, $blue]); |
|
| 29 | + return new Rgb([ $red, $green, $blue ]); |
|
| 30 | 30 | } |
| 31 | 31 | } |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function __construct($value) |
| 26 | 26 | {
|
| 27 | - if (! is_null($value)) {
|
|
| 28 | - throw new InvalidTypeException($value, ['object']); |
|
| 27 | + if (!is_null($value)) {
|
|
| 28 | + throw new InvalidTypeException($value, [ 'object' ]); |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | parent::__construct($value); |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | return null; |
| 139 | 139 | case 'unknown type': |
| 140 | 140 | default: |
| 141 | - throw new InvalidArgumentException('Cannot diff type [' . $this->type . '].');
|
|
| 141 | + throw new InvalidArgumentException('Cannot diff type ['.$this->type.'].');
|
|
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | return strlen($this->getValue()); |
| 160 | 160 | case 'unknown type': |
| 161 | 161 | default: |
| 162 | - throw new InvalidArgumentException('Cannot count type [' . $this->type . '].');
|
|
| 162 | + throw new InvalidArgumentException('Cannot count type ['.$this->type.'].');
|
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | } |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | { |
| 15 | 15 | /** |
| 16 | 16 | * @param array $array |
| 17 | - * @return string |
|
| 17 | + * @return Attribute |
|
| 18 | 18 | */ |
| 19 | 19 | public static function fromArray(array $array) |
| 20 | 20 | { |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | private static function fromArrayString() |
| 29 | 29 | { |
| 30 | - return function ($key, $value) { |
|
| 30 | + return function($key, $value) { |
|
| 31 | 31 | return is_null($value) ? $key : $key.'="'.$value.'"'; |
| 32 | 32 | }; |
| 33 | 33 | } |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | |
| 34 | 34 | /** |
| 35 | 35 | * @param string $key |
| 36 | - * @return mixed |
|
| 36 | + * @return boolean |
|
| 37 | 37 | */ |
| 38 | 38 | public static function get($key) |
| 39 | 39 | { |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | public function getKey($key) |
| 16 | 16 | { |
| 17 | - return $this->keyExists($key) ? $this->getValue()[$key] : false; |
|
| 17 | + return $this->keyExists($key) ? $this->getValue()[ $key ] : false; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -33,7 +33,7 @@ |
||
| 33 | 33 | */ |
| 34 | 34 | public function equals(ValueObject $object) |
| 35 | 35 | { |
| 36 | - if (! $object instanceof VOArray) { |
|
| 36 | + if (!$object instanceof VOArray) { |
|
| 37 | 37 | throw new InvalidTypeException($object, [ VOArray::class ]); |
| 38 | 38 | } |
| 39 | 39 | |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | */ |
| 26 | 26 | public function arrayToPairString(array $array) |
| 27 | 27 | { |
| 28 | - return implode(',', array_map(function ($key, $value) { |
|
| 28 | + return implode(',', array_map(function($key, $value) { |
|
| 29 | 29 | return $key.'='.$value; |
| 30 | 30 | }, array_keys($array), $array)); |
| 31 | 31 | } |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | public function arrayToAttributeArray(array $array) |
| 38 | 38 | { |
| 39 | - return implode(' ', array_map(function ($key, $value) { |
|
| 39 | + return implode(' ', array_map(function($key, $value) { |
|
| 40 | 40 | return is_null($value) ? $key : $key.'="'.$value.'"'; |
| 41 | 41 | }, array_keys($array), $array)); |
| 42 | 42 | } |