@@ -25,7 +25,7 @@ |
||
| 25 | 25 | */ |
| 26 | 26 | public function getCompiled() |
| 27 | 27 | { |
| 28 | - return $this->name.'('.$this->compiler->compileValue($this->args).')'; |
|
| 28 | + return $this->name . '(' . $this->compiler->compileValue($this->args) . ')'; |
|
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | /** |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $blue = round($this->blue); |
| 33 | 33 | |
| 34 | 34 | if ($this->alpha !== null && $this->alpha != 1) { |
| 35 | - return 'rgba('.$red.','.$green.','.$blue.','.$this->alpha.')'; |
|
| 35 | + return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $this->alpha . ')'; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $hex = sprintf("#%02x%02x%02x", $red, $green, $blue); |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | if ($this->options['compressColors']) { |
| 41 | 41 | // Converting hex color to short notation (e.g. #003399 to #039) |
| 42 | 42 | if ($hex[1] === $hex[2] && $hex[3] === $hex[4] && $hex[5] === $hex[6]) { |
| 43 | - $hex = '#'.$hex[1].$hex[3].$hex[5]; |
|
| 43 | + $hex = '#' . $hex[1] . $hex[3] . $hex[5]; |
|
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $num = round($num, $this->options['numberPrecision']); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - return $num.$this->unit; |
|
| 33 | + return $num . $this->unit; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | /** |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | public static function factory(Compiler $compiler, Coerce $coerce, array $options, array $value) |
| 55 | 55 | { |
| 56 | 56 | $nameParts = explode('_', $value[0]); |
| 57 | - $camelCase = array_reduce($nameParts, function ($carry, $item) { |
|
| 58 | - return $carry.ucfirst($item); |
|
| 57 | + $camelCase = array_reduce($nameParts, function($carry, $item) { |
|
| 58 | + return $carry . ucfirst($item); |
|
| 59 | 59 | }, ''); |
| 60 | - $valueClassName = 'LesserPhp\Compiler\Value\\'.$camelCase.'Value'; |
|
| 60 | + $valueClassName = 'LesserPhp\Compiler\Value\\' . $camelCase . 'Value'; |
|
| 61 | 61 | |
| 62 | 62 | if (class_exists($valueClassName)) { |
| 63 | 63 | $valueClass = new $valueClassName($compiler, $coerce, $options); |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - throw new \UnexpectedValueException('unknown value type: '.$value[0]); |
|
| 71 | + throw new \UnexpectedValueException('unknown value type: ' . $value[0]); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | /** |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | } |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | - return $this->delimiter.implode($content).$this->delimiter; |
|
| 35 | + return $this->delimiter . implode($content) . $this->delimiter; |
|
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | /** |
@@ -1111,23 +1111,23 @@ discard block |
||
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | 1113 | |
| 1114 | - /** |
|
| 1115 | - * Compiles a primitive value into a CSS property value. |
|
| 1116 | - * |
|
| 1117 | - * Values in lessphp are typed by being wrapped in arrays, their format is |
|
| 1118 | - * typically: |
|
| 1119 | - * |
|
| 1120 | - * array(type, contents [, additional_contents]*) |
|
| 1121 | - * |
|
| 1122 | - * The input is expected to be reduced. This function will not work on |
|
| 1123 | - * things like expressions and variables. |
|
| 1124 | - * |
|
| 1125 | - * @param array $value |
|
| 1126 | - * @param array $options |
|
| 1127 | - * |
|
| 1128 | - * @return string |
|
| 1129 | - * @throws GeneralException |
|
| 1130 | - */ |
|
| 1114 | + /** |
|
| 1115 | + * Compiles a primitive value into a CSS property value. |
|
| 1116 | + * |
|
| 1117 | + * Values in lessphp are typed by being wrapped in arrays, their format is |
|
| 1118 | + * typically: |
|
| 1119 | + * |
|
| 1120 | + * array(type, contents [, additional_contents]*) |
|
| 1121 | + * |
|
| 1122 | + * The input is expected to be reduced. This function will not work on |
|
| 1123 | + * things like expressions and variables. |
|
| 1124 | + * |
|
| 1125 | + * @param array $value |
|
| 1126 | + * @param array $options |
|
| 1127 | + * |
|
| 1128 | + * @return string |
|
| 1129 | + * @throws GeneralException |
|
| 1130 | + */ |
|
| 1131 | 1131 | public function compileValue(array $value, array $options = []) |
| 1132 | 1132 | { |
| 1133 | 1133 | try { |
@@ -2055,9 +2055,9 @@ discard block |
||
| 2055 | 2055 | $this->formatterName = $name; |
| 2056 | 2056 | } |
| 2057 | 2057 | |
| 2058 | - public function setFormatterClass($formatter) |
|
| 2059 | - { |
|
| 2060 | - $this->formatter = $formatter; |
|
| 2058 | + public function setFormatterClass($formatter) |
|
| 2059 | + { |
|
| 2060 | + $this->formatter = $formatter; |
|
| 2061 | 2061 | } |
| 2062 | 2062 | |
| 2063 | 2063 | /** |