@@ -4,7 +4,7 @@ |
||
| 4 | 4 | throw new \Exception('scssphp requires PHP 5.6 or above'); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -if (! class_exists('ScssPhp\ScssPhp\Version', false)) { |
|
| 7 | +if (!class_exists('ScssPhp\ScssPhp\Version', false)) { |
|
| 8 | 8 | include_once __DIR__ . '/src/Base/Range.php'; |
| 9 | 9 | include_once __DIR__ . '/src/Block.php'; |
| 10 | 10 | include_once __DIR__ . '/src/Cache.php'; |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $this->sourceName = $sourceName ?: '(stdin)'; |
| 91 | 91 | $this->sourceIndex = $sourceIndex; |
| 92 | 92 | $this->charset = null; |
| 93 | - $this->utf8 = ! $encoding || strtolower($encoding) === 'utf-8'; |
|
| 93 | + $this->utf8 = !$encoding || strtolower($encoding) === 'utf-8'; |
|
| 94 | 94 | $this->patternModifiers = $this->utf8 ? 'Aisu' : 'Ais'; |
| 95 | 95 | $this->commentsSeen = []; |
| 96 | 96 | $this->commentsSeen = []; |
@@ -180,7 +180,7 @@ discard block |
||
| 180 | 180 | ]; |
| 181 | 181 | $v = $this->cache->getCache('parse', $cacheKey, $parseOptions); |
| 182 | 182 | |
| 183 | - if (! \is_null($v)) { |
|
| 183 | + if (!\is_null($v)) { |
|
| 184 | 184 | return $v; |
| 185 | 185 | } |
| 186 | 186 | } |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $this->throwParseError(); |
| 213 | 213 | } |
| 214 | 214 | |
| 215 | - if (! empty($this->env->parent)) { |
|
| 215 | + if (!empty($this->env->parent)) { |
|
| 216 | 216 | $this->throwParseError('unclosed block'); |
| 217 | 217 | } |
| 218 | 218 | |
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | isset($argUsing) ? $argUsing : null |
| 434 | 434 | ]; |
| 435 | 435 | |
| 436 | - if (! empty($hasBlock)) { |
|
| 436 | + if (!empty($hasBlock)) { |
|
| 437 | 437 | $include = $this->pushSpecialBlock(Type::T_INCLUDE, $s); |
| 438 | 438 | $include->child = $child; |
| 439 | 439 | } else { |
@@ -608,7 +608,7 @@ discard block |
||
| 608 | 608 | |
| 609 | 609 | while ( |
| 610 | 610 | $cond[0] === Type::T_LIST && |
| 611 | - ! empty($cond['enclosing']) && |
|
| 611 | + !empty($cond['enclosing']) && |
|
| 612 | 612 | $cond['enclosing'] === 'parent' && |
| 613 | 613 | \count($cond[2]) == 1 |
| 614 | 614 | ) { |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | |
| 662 | 662 | while ( |
| 663 | 663 | $cond[0] === Type::T_LIST && |
| 664 | - ! empty($cond['enclosing']) && |
|
| 664 | + !empty($cond['enclosing']) && |
|
| 665 | 665 | $cond['enclosing'] === 'parent' && |
| 666 | 666 | \count($cond[2]) == 1 |
| 667 | 667 | ) { |
@@ -777,7 +777,7 @@ discard block |
||
| 777 | 777 | $this->valueList($charset) && |
| 778 | 778 | $this->end() |
| 779 | 779 | ) { |
| 780 | - if (! isset($this->charset)) { |
|
| 780 | + if (!isset($this->charset)) { |
|
| 781 | 781 | $statement = [Type::T_CHARSET, $charset]; |
| 782 | 782 | |
| 783 | 783 | list($line, $column) = $this->getSourcePosition($s); |
@@ -849,8 +849,8 @@ discard block |
||
| 849 | 849 | |
| 850 | 850 | $inCssSelector = null; |
| 851 | 851 | if ($this->cssOnly) { |
| 852 | - $inCssSelector = (! empty($this->env->parent) && |
|
| 853 | - ! in_array($this->env->type, [Type::T_DIRECTIVE, Type::T_MEDIA])); |
|
| 852 | + $inCssSelector = (!empty($this->env->parent) && |
|
| 853 | + !in_array($this->env->type, [Type::T_DIRECTIVE, Type::T_MEDIA])); |
|
| 854 | 854 | } |
| 855 | 855 | // custom properties : right part is static |
| 856 | 856 | if ( |
@@ -861,7 +861,7 @@ discard block |
||
| 861 | 861 | $start = $this->count; |
| 862 | 862 | |
| 863 | 863 | // but can be complex and finish with ; or } |
| 864 | - foreach ([';','}'] as $ending) { |
|
| 864 | + foreach ([';', '}'] as $ending) { |
|
| 865 | 865 | if ( |
| 866 | 866 | $this->openString($ending, $stringValue, '(', ')', false) && |
| 867 | 867 | $this->end() |
@@ -1006,7 +1006,7 @@ discard block |
||
| 1006 | 1006 | if ($this->matchChar('}', false)) { |
| 1007 | 1007 | $block = $this->popBlock(); |
| 1008 | 1008 | |
| 1009 | - if (! isset($block->type) || $block->type !== Type::T_IF) { |
|
| 1009 | + if (!isset($block->type) || $block->type !== Type::T_IF) { |
|
| 1010 | 1010 | if ($this->env->parent) { |
| 1011 | 1011 | $this->append(null); // collect comments before next statement if needed |
| 1012 | 1012 | } |
@@ -1066,7 +1066,7 @@ discard block |
||
| 1066 | 1066 | $b->comments = []; |
| 1067 | 1067 | $b->parent = $this->env; |
| 1068 | 1068 | |
| 1069 | - if (! $this->env) { |
|
| 1069 | + if (!$this->env) { |
|
| 1070 | 1070 | $b->children = []; |
| 1071 | 1071 | } elseif (empty($this->env->children)) { |
| 1072 | 1072 | $this->env->children = $this->env->comments; |
@@ -1152,7 +1152,7 @@ discard block |
||
| 1152 | 1152 | */ |
| 1153 | 1153 | protected function peek($regex, &$out, $from = null) |
| 1154 | 1154 | { |
| 1155 | - if (! isset($from)) { |
|
| 1155 | + if (!isset($from)) { |
|
| 1156 | 1156 | $from = $this->count; |
| 1157 | 1157 | } |
| 1158 | 1158 | |
@@ -1198,7 +1198,7 @@ discard block |
||
| 1198 | 1198 | } |
| 1199 | 1199 | } |
| 1200 | 1200 | |
| 1201 | - if (! isset($token)) { |
|
| 1201 | + if (!isset($token)) { |
|
| 1202 | 1202 | return false; |
| 1203 | 1203 | } |
| 1204 | 1204 | |
@@ -1226,13 +1226,13 @@ discard block |
||
| 1226 | 1226 | { |
| 1227 | 1227 | $r = '/' . $regex . '/' . $this->patternModifiers; |
| 1228 | 1228 | |
| 1229 | - if (! preg_match($r, $this->buffer, $out, null, $this->count)) { |
|
| 1229 | + if (!preg_match($r, $this->buffer, $out, null, $this->count)) { |
|
| 1230 | 1230 | return false; |
| 1231 | 1231 | } |
| 1232 | 1232 | |
| 1233 | 1233 | $this->count += \strlen($out[0]); |
| 1234 | 1234 | |
| 1235 | - if (! isset($eatWhitespace)) { |
|
| 1235 | + if (!isset($eatWhitespace)) { |
|
| 1236 | 1236 | $eatWhitespace = $this->eatWhiteDefault; |
| 1237 | 1237 | } |
| 1238 | 1238 | |
@@ -1253,13 +1253,13 @@ discard block |
||
| 1253 | 1253 | */ |
| 1254 | 1254 | protected function matchChar($char, $eatWhitespace = null) |
| 1255 | 1255 | { |
| 1256 | - if (! isset($this->buffer[$this->count]) || $this->buffer[$this->count] !== $char) { |
|
| 1256 | + if (!isset($this->buffer[$this->count]) || $this->buffer[$this->count] !== $char) { |
|
| 1257 | 1257 | return false; |
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | 1260 | $this->count++; |
| 1261 | 1261 | |
| 1262 | - if (! isset($eatWhitespace)) { |
|
| 1262 | + if (!isset($eatWhitespace)) { |
|
| 1263 | 1263 | $eatWhitespace = $this->eatWhiteDefault; |
| 1264 | 1264 | } |
| 1265 | 1265 | |
@@ -1287,7 +1287,7 @@ discard block |
||
| 1287 | 1287 | |
| 1288 | 1288 | $this->count += $len; |
| 1289 | 1289 | |
| 1290 | - if (! isset($eatWhitespace)) { |
|
| 1290 | + if (!isset($eatWhitespace)) { |
|
| 1291 | 1291 | $eatWhitespace = $this->eatWhiteDefault; |
| 1292 | 1292 | } |
| 1293 | 1293 | |
@@ -1346,7 +1346,7 @@ discard block |
||
| 1346 | 1346 | // remaining part |
| 1347 | 1347 | $c = substr($this->buffer, $this->count, $endCommentCount - $this->count); |
| 1348 | 1348 | |
| 1349 | - if (! $comment) { |
|
| 1349 | + if (!$comment) { |
|
| 1350 | 1350 | // single part static comment |
| 1351 | 1351 | $this->appendComment([Type::T_COMMENT, $c]); |
| 1352 | 1352 | } else { |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | */ |
| 1376 | 1376 | protected function appendComment($comment) |
| 1377 | 1377 | { |
| 1378 | - if (! $this->discardComments) { |
|
| 1378 | + if (!$this->discardComments) { |
|
| 1379 | 1379 | $this->env->comments[] = $comment; |
| 1380 | 1380 | } |
| 1381 | 1381 | } |
@@ -1388,8 +1388,8 @@ discard block |
||
| 1388 | 1388 | */ |
| 1389 | 1389 | protected function append($statement, $pos = null) |
| 1390 | 1390 | { |
| 1391 | - if (! \is_null($statement)) { |
|
| 1392 | - if (! \is_null($pos)) { |
|
| 1391 | + if (!\is_null($statement)) { |
|
| 1392 | + if (!\is_null($pos)) { |
|
| 1393 | 1393 | list($line, $column) = $this->getSourcePosition($pos); |
| 1394 | 1394 | |
| 1395 | 1395 | $statement[static::SOURCE_LINE] = $line; |
@@ -1692,7 +1692,7 @@ discard block |
||
| 1692 | 1692 | |
| 1693 | 1693 | $keyword = null; |
| 1694 | 1694 | |
| 1695 | - if (! $this->variable($keyword) || ! $this->matchChar(':')) { |
|
| 1695 | + if (!$this->variable($keyword) || !$this->matchChar(':')) { |
|
| 1696 | 1696 | $this->seek($s); |
| 1697 | 1697 | |
| 1698 | 1698 | $keyword = null; |
@@ -1731,7 +1731,7 @@ discard block |
||
| 1731 | 1731 | return true; |
| 1732 | 1732 | } |
| 1733 | 1733 | |
| 1734 | - if (! $endChar && $this->end()) { |
|
| 1734 | + if (!$endChar && $this->end()) { |
|
| 1735 | 1735 | return true; |
| 1736 | 1736 | } |
| 1737 | 1737 | } |
@@ -1757,7 +1757,7 @@ discard block |
||
| 1757 | 1757 | return true; |
| 1758 | 1758 | } |
| 1759 | 1759 | |
| 1760 | - if (! $endChar && $this->end()) { |
|
| 1760 | + if (!$endChar && $this->end()) { |
|
| 1761 | 1761 | return true; |
| 1762 | 1762 | } |
| 1763 | 1763 | } |
@@ -1808,7 +1808,7 @@ discard block |
||
| 1808 | 1808 | return true; |
| 1809 | 1809 | } |
| 1810 | 1810 | |
| 1811 | - if (! $mandatoryParenthesis) { |
|
| 1811 | + if (!$mandatoryParenthesis) { |
|
| 1812 | 1812 | $this->seek($s); |
| 1813 | 1813 | |
| 1814 | 1814 | if ($this->valueList($out)) { |
@@ -1854,7 +1854,7 @@ discard block |
||
| 1854 | 1854 | $items[] = $value; |
| 1855 | 1855 | |
| 1856 | 1856 | if ($delim) { |
| 1857 | - if (! $this->literal($delim, \strlen($delim))) { |
|
| 1857 | + if (!$this->literal($delim, \strlen($delim))) { |
|
| 1858 | 1858 | break; |
| 1859 | 1859 | } |
| 1860 | 1860 | |
@@ -1869,7 +1869,7 @@ discard block |
||
| 1869 | 1869 | |
| 1870 | 1870 | if ( |
| 1871 | 1871 | strlen($word) > 1 && |
| 1872 | - in_array($last_char, [ "'", '"']) && |
|
| 1872 | + in_array($last_char, ["'", '"']) && |
|
| 1873 | 1873 | substr($word, -2, 1) !== '\\' |
| 1874 | 1874 | ) { |
| 1875 | 1875 | // if there is a non escaped opening quote in the keyword, this seems unlikely a mistake |
@@ -1915,7 +1915,7 @@ discard block |
||
| 1915 | 1915 | } |
| 1916 | 1916 | } |
| 1917 | 1917 | |
| 1918 | - if (! $items) { |
|
| 1918 | + if (!$items) { |
|
| 1919 | 1919 | $this->seek($s); |
| 1920 | 1920 | |
| 1921 | 1921 | return false; |
@@ -1982,7 +1982,7 @@ discard block |
||
| 1982 | 1982 | $this->seek($s); |
| 1983 | 1983 | } |
| 1984 | 1984 | |
| 1985 | - if (! $listOnly && $this->value($lhs)) { |
|
| 1985 | + if (!$listOnly && $this->value($lhs)) { |
|
| 1986 | 1986 | if ($lookForExp) { |
| 1987 | 1987 | $out = $this->expHelper($lhs, 0); |
| 1988 | 1988 | } else { |
@@ -2029,11 +2029,11 @@ discard block |
||
| 2029 | 2029 | |
| 2030 | 2030 | if ( |
| 2031 | 2031 | $this->valueList($out) && |
| 2032 | - $this->matchChar($closingParen) && ! ($closingParen === ')' && |
|
| 2032 | + $this->matchChar($closingParen) && !($closingParen === ')' && |
|
| 2033 | 2033 | \in_array($out[0], [Type::T_EXPRESSION, Type::T_UNARY])) && |
| 2034 | 2034 | \in_array(Type::T_LIST, $allowedTypes) |
| 2035 | 2035 | ) { |
| 2036 | - if ($out[0] !== Type::T_LIST || ! empty($out['enclosing'])) { |
|
| 2036 | + if ($out[0] !== Type::T_LIST || !empty($out['enclosing'])) { |
|
| 2037 | 2037 | $out = [Type::T_LIST, '', [$out]]; |
| 2038 | 2038 | } |
| 2039 | 2039 | |
@@ -2086,11 +2086,11 @@ discard block |
||
| 2086 | 2086 | $op = $m[1]; |
| 2087 | 2087 | |
| 2088 | 2088 | // don't turn negative numbers into expressions |
| 2089 | - if ($op === '-' && $whiteBefore && ! $whiteAfter && ! $varAfter) { |
|
| 2089 | + if ($op === '-' && $whiteBefore && !$whiteAfter && !$varAfter) { |
|
| 2090 | 2090 | break; |
| 2091 | 2091 | } |
| 2092 | 2092 | |
| 2093 | - if (! $this->value($rhs) && ! $this->expression($rhs, true, false)) { |
|
| 2093 | + if (!$this->value($rhs) && !$this->expression($rhs, true, false)) { |
|
| 2094 | 2094 | break; |
| 2095 | 2095 | } |
| 2096 | 2096 | |
@@ -2119,7 +2119,7 @@ discard block |
||
| 2119 | 2119 | */ |
| 2120 | 2120 | protected function value(&$out) |
| 2121 | 2121 | { |
| 2122 | - if (! isset($this->buffer[$this->count])) { |
|
| 2122 | + if (!isset($this->buffer[$this->count])) { |
|
| 2123 | 2123 | return false; |
| 2124 | 2124 | } |
| 2125 | 2125 | |
@@ -2226,7 +2226,7 @@ discard block |
||
| 2226 | 2226 | |
| 2227 | 2227 | if ( |
| 2228 | 2228 | $this->keyword($inner) && |
| 2229 | - ! $this->func($inner, $out) |
|
| 2229 | + !$this->func($inner, $out) |
|
| 2230 | 2230 | ) { |
| 2231 | 2231 | $out = [Type::T_UNARY, '-', $inner, $this->inParens]; |
| 2232 | 2232 | |
@@ -2404,7 +2404,7 @@ discard block |
||
| 2404 | 2404 | return true; |
| 2405 | 2405 | } |
| 2406 | 2406 | |
| 2407 | - if ($name !== 'expression' && ! preg_match('/^(-[a-z]+-)?calc$/', $name)) { |
|
| 2407 | + if ($name !== 'expression' && !preg_match('/^(-[a-z]+-)?calc$/', $name)) { |
|
| 2408 | 2408 | $ss = $this->count; |
| 2409 | 2409 | |
| 2410 | 2410 | if ( |
@@ -2425,7 +2425,7 @@ discard block |
||
| 2425 | 2425 | ) { |
| 2426 | 2426 | $args = []; |
| 2427 | 2427 | |
| 2428 | - if (! empty($str)) { |
|
| 2428 | + if (!empty($str)) { |
|
| 2429 | 2429 | $args[] = [null, [Type::T_STRING, '', [$str]]]; |
| 2430 | 2430 | } |
| 2431 | 2431 | |
@@ -2467,14 +2467,14 @@ discard block |
||
| 2467 | 2467 | |
| 2468 | 2468 | $args[] = $arg; |
| 2469 | 2469 | |
| 2470 | - if (! $this->matchChar(',')) { |
|
| 2470 | + if (!$this->matchChar(',')) { |
|
| 2471 | 2471 | break; |
| 2472 | 2472 | } |
| 2473 | 2473 | |
| 2474 | 2474 | $args[] = [Type::T_STRING, '', [', ']]; |
| 2475 | 2475 | } |
| 2476 | 2476 | |
| 2477 | - if (! $this->matchChar(')') || ! $args) { |
|
| 2477 | + if (!$this->matchChar(')') || !$args) { |
|
| 2478 | 2478 | $this->seek($s); |
| 2479 | 2479 | |
| 2480 | 2480 | return false; |
@@ -2518,7 +2518,7 @@ discard block |
||
| 2518 | 2518 | if ($this->literal('...', 3)) { |
| 2519 | 2519 | $sss = $this->count; |
| 2520 | 2520 | |
| 2521 | - if (! $this->matchChar(')')) { |
|
| 2521 | + if (!$this->matchChar(')')) { |
|
| 2522 | 2522 | $this->throwParseError('... has to be after the final argument'); |
| 2523 | 2523 | } |
| 2524 | 2524 | |
@@ -2531,12 +2531,12 @@ discard block |
||
| 2531 | 2531 | |
| 2532 | 2532 | $args[] = $arg; |
| 2533 | 2533 | |
| 2534 | - if (! $this->matchChar(',')) { |
|
| 2534 | + if (!$this->matchChar(',')) { |
|
| 2535 | 2535 | break; |
| 2536 | 2536 | } |
| 2537 | 2537 | } |
| 2538 | 2538 | |
| 2539 | - if (! $this->matchChar(')')) { |
|
| 2539 | + if (!$this->matchChar(')')) { |
|
| 2540 | 2540 | $this->seek($s); |
| 2541 | 2541 | |
| 2542 | 2542 | return false; |
@@ -2558,7 +2558,7 @@ discard block |
||
| 2558 | 2558 | { |
| 2559 | 2559 | $s = $this->count; |
| 2560 | 2560 | |
| 2561 | - if (! $this->matchChar('(')) { |
|
| 2561 | + if (!$this->matchChar('(')) { |
|
| 2562 | 2562 | return false; |
| 2563 | 2563 | } |
| 2564 | 2564 | |
@@ -2573,12 +2573,12 @@ discard block |
||
| 2573 | 2573 | $keys[] = $key; |
| 2574 | 2574 | $values[] = $value; |
| 2575 | 2575 | |
| 2576 | - if (! $this->matchChar(',')) { |
|
| 2576 | + if (!$this->matchChar(',')) { |
|
| 2577 | 2577 | break; |
| 2578 | 2578 | } |
| 2579 | 2579 | } |
| 2580 | 2580 | |
| 2581 | - if (! $keys || ! $this->matchChar(')')) { |
|
| 2581 | + if (!$keys || !$this->matchChar(')')) { |
|
| 2582 | 2582 | $this->seek($s); |
| 2583 | 2583 | |
| 2584 | 2584 | return false; |
@@ -2601,7 +2601,7 @@ discard block |
||
| 2601 | 2601 | $s = $this->count; |
| 2602 | 2602 | |
| 2603 | 2603 | if ($this->match('(#([0-9a-f]+)\b)', $m)) { |
| 2604 | - if (\in_array(\strlen($m[2]), [3,4,6,8])) { |
|
| 2604 | + if (\in_array(\strlen($m[2]), [3, 4, 6, 8])) { |
|
| 2605 | 2605 | $out = [Type::T_KEYWORD, $m[0]]; |
| 2606 | 2606 | |
| 2607 | 2607 | return true; |
@@ -2627,7 +2627,7 @@ discard block |
||
| 2627 | 2627 | $s = $this->count; |
| 2628 | 2628 | |
| 2629 | 2629 | if ($this->match('([0-9]*(\.)?[0-9]+)([%a-zA-Z]+)?', $m, false)) { |
| 2630 | - if (\strlen($this->buffer) === $this->count || ! ctype_digit($this->buffer[$this->count])) { |
|
| 2630 | + if (\strlen($this->buffer) === $this->count || !ctype_digit($this->buffer[$this->count])) { |
|
| 2631 | 2631 | $this->whitespace(); |
| 2632 | 2632 | |
| 2633 | 2633 | $unit = new Node\Number($m[1], empty($m[3]) ? '' : $m[3]); |
@@ -2789,7 +2789,7 @@ discard block |
||
| 2789 | 2789 | |
| 2790 | 2790 | $this->eatWhiteDefault = $oldWhite; |
| 2791 | 2791 | |
| 2792 | - if (! $parts) { |
|
| 2792 | + if (!$parts) { |
|
| 2793 | 2793 | return false; |
| 2794 | 2794 | } |
| 2795 | 2795 | |
@@ -2818,7 +2818,7 @@ discard block |
||
| 2818 | 2818 | $oldWhite = $this->eatWhiteDefault; |
| 2819 | 2819 | $this->eatWhiteDefault = false; |
| 2820 | 2820 | |
| 2821 | - if ($nestingOpen && ! $nestingClose) { |
|
| 2821 | + if ($nestingOpen && !$nestingClose) { |
|
| 2822 | 2822 | $nestingClose = $end; |
| 2823 | 2823 | } |
| 2824 | 2824 | |
@@ -2844,7 +2844,7 @@ discard block |
||
| 2844 | 2844 | |
| 2845 | 2845 | $this->count -= \strlen($tok); |
| 2846 | 2846 | |
| 2847 | - if ($tok === $end && ! $nestingLevel) { |
|
| 2847 | + if ($tok === $end && !$nestingLevel) { |
|
| 2848 | 2848 | break; |
| 2849 | 2849 | } |
| 2850 | 2850 | |
@@ -2868,7 +2868,7 @@ discard block |
||
| 2868 | 2868 | |
| 2869 | 2869 | $this->eatWhiteDefault = $oldWhite; |
| 2870 | 2870 | |
| 2871 | - if (! $content || $tok !== $end) { |
|
| 2871 | + if (!$content || $tok !== $end) { |
|
| 2872 | 2872 | return false; |
| 2873 | 2873 | } |
| 2874 | 2874 | |
@@ -2960,7 +2960,7 @@ discard block |
||
| 2960 | 2960 | continue; |
| 2961 | 2961 | } |
| 2962 | 2962 | |
| 2963 | - if (! $parts && $this->match('[:.#]', $m, false)) { |
|
| 2963 | + if (!$parts && $this->match('[:.#]', $m, false)) { |
|
| 2964 | 2964 | // css hacks |
| 2965 | 2965 | $parts[] = $m[0]; |
| 2966 | 2966 | continue; |
@@ -2971,13 +2971,13 @@ discard block |
||
| 2971 | 2971 | |
| 2972 | 2972 | $this->eatWhiteDefault = $oldWhite; |
| 2973 | 2973 | |
| 2974 | - if (! $parts) { |
|
| 2974 | + if (!$parts) { |
|
| 2975 | 2975 | return false; |
| 2976 | 2976 | } |
| 2977 | 2977 | |
| 2978 | 2978 | // match comment hack |
| 2979 | 2979 | if (preg_match(static::$whitePattern, $this->buffer, $m, null, $this->count)) { |
| 2980 | - if (! empty($m[0])) { |
|
| 2980 | + if (!empty($m[0])) { |
|
| 2981 | 2981 | $parts[] = $m[0]; |
| 2982 | 2982 | $this->count += \strlen($m[0]); |
| 2983 | 2983 | } |
@@ -3001,7 +3001,7 @@ discard block |
||
| 3001 | 3001 | { |
| 3002 | 3002 | $s = $this->count; |
| 3003 | 3003 | |
| 3004 | - if (! $this->literal('--', 2, false)) { |
|
| 3004 | + if (!$this->literal('--', 2, false)) { |
|
| 3005 | 3005 | return false; |
| 3006 | 3006 | } |
| 3007 | 3007 | |
@@ -3065,7 +3065,7 @@ discard block |
||
| 3065 | 3065 | while ($this->selector($sel, $subSelector)) { |
| 3066 | 3066 | $selectors[] = $sel; |
| 3067 | 3067 | |
| 3068 | - if (! $this->matchChar(',', true)) { |
|
| 3068 | + if (!$this->matchChar(',', true)) { |
|
| 3069 | 3069 | break; |
| 3070 | 3070 | } |
| 3071 | 3071 | |
@@ -3074,7 +3074,7 @@ discard block |
||
| 3074 | 3074 | } |
| 3075 | 3075 | } |
| 3076 | 3076 | |
| 3077 | - if (! $selectors) { |
|
| 3077 | + if (!$selectors) { |
|
| 3078 | 3078 | $this->seek($s); |
| 3079 | 3079 | |
| 3080 | 3080 | return false; |
@@ -3126,7 +3126,7 @@ discard block |
||
| 3126 | 3126 | break; |
| 3127 | 3127 | } |
| 3128 | 3128 | |
| 3129 | - if (! $selector) { |
|
| 3129 | + if (!$selector) { |
|
| 3130 | 3130 | return false; |
| 3131 | 3131 | } |
| 3132 | 3132 | |
@@ -3159,7 +3159,7 @@ discard block |
||
| 3159 | 3159 | } |
| 3160 | 3160 | |
| 3161 | 3161 | for (;;) { |
| 3162 | - if (! isset($this->buffer[$this->count])) { |
|
| 3162 | + if (!isset($this->buffer[$this->count])) { |
|
| 3163 | 3163 | break; |
| 3164 | 3164 | } |
| 3165 | 3165 | |
@@ -3286,7 +3286,7 @@ discard block |
||
| 3286 | 3286 | ) { |
| 3287 | 3287 | $parts[] = '('; |
| 3288 | 3288 | |
| 3289 | - if (! empty($str)) { |
|
| 3289 | + if (!empty($str)) { |
|
| 3290 | 3290 | $parts[] = $str; |
| 3291 | 3291 | } |
| 3292 | 3292 | |
@@ -3321,7 +3321,7 @@ discard block |
||
| 3321 | 3321 | ) { |
| 3322 | 3322 | $parts[] = '['; |
| 3323 | 3323 | |
| 3324 | - if (! empty($str)) { |
|
| 3324 | + if (!empty($str)) { |
|
| 3325 | 3325 | $parts[] = $str; |
| 3326 | 3326 | } |
| 3327 | 3327 | |
@@ -3347,7 +3347,7 @@ discard block |
||
| 3347 | 3347 | |
| 3348 | 3348 | $this->eatWhiteDefault = $oldWhite; |
| 3349 | 3349 | |
| 3350 | - if (! $parts) { |
|
| 3350 | + if (!$parts) { |
|
| 3351 | 3351 | return false; |
| 3352 | 3352 | } |
| 3353 | 3353 | |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | $this->write($inner . implode($glue, $block->lines)); |
| 64 | 64 | |
| 65 | - if (empty($block->selectors) || ! empty($block->children)) { |
|
| 65 | + if (empty($block->selectors) || !empty($block->children)) { |
|
| 66 | 66 | $this->write($this->break); |
| 67 | 67 | } |
| 68 | 68 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | static $previousHasSelector; |
| 83 | 83 | |
| 84 | 84 | if ($block->type === 'root') { |
| 85 | - $depths = [ 0 ]; |
|
| 85 | + $depths = [0]; |
|
| 86 | 86 | $downLevel = ''; |
| 87 | 87 | $closeBlock = ''; |
| 88 | 88 | $this->depth = 0; |
@@ -99,8 +99,8 @@ discard block |
||
| 99 | 99 | $this->depth--; |
| 100 | 100 | |
| 101 | 101 | if ( |
| 102 | - ! $this->depth && ($block->depth <= 1 || (! $this->indentLevel && $block->type === Type::T_COMMENT)) && |
|
| 103 | - (($block->selectors && ! $isMediaOrDirective) || $previousHasSelector) |
|
| 102 | + !$this->depth && ($block->depth <= 1 || (!$this->indentLevel && $block->type === Type::T_COMMENT)) && |
|
| 103 | + (($block->selectors && !$isMediaOrDirective) || $previousHasSelector) |
|
| 104 | 104 | ) { |
| 105 | 105 | $downLevel = $this->break; |
| 106 | 106 | } |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | $this->currentBlock = $block; |
| 118 | 118 | |
| 119 | - if (! empty($block->lines) || (! empty($block->children) && ($this->depth < 1 || $isSupport))) { |
|
| 119 | + if (!empty($block->lines) || (!empty($block->children) && ($this->depth < 1 || $isSupport))) { |
|
| 120 | 120 | if ($block->depth > end($depths)) { |
| 121 | - if (! $previousEmpty || $this->depth < 1) { |
|
| 121 | + if (!$previousEmpty || $this->depth < 1) { |
|
| 122 | 122 | $this->depth++; |
| 123 | 123 | |
| 124 | 124 | $depths[] = $block->depth; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $previousEmpty = ($block->type === Type::T_COMMENT); |
| 135 | 135 | $previousHasSelector = false; |
| 136 | 136 | |
| 137 | - if (! empty($block->selectors)) { |
|
| 137 | + if (!empty($block->selectors)) { |
|
| 138 | 138 | if ($closeBlock) { |
| 139 | 139 | $this->write($closeBlock); |
| 140 | 140 | $closeBlock = ''; |
@@ -150,7 +150,7 @@ discard block |
||
| 150 | 150 | $this->indentLevel++; |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - if (! empty($block->lines)) { |
|
| 153 | + if (!empty($block->lines)) { |
|
| 154 | 154 | if ($closeBlock) { |
| 155 | 155 | $this->write($closeBlock); |
| 156 | 156 | $closeBlock = ''; |
@@ -166,8 +166,8 @@ discard block |
||
| 166 | 166 | $closeBlock = $this->break; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - if (! empty($block->children)) { |
|
| 170 | - if ($this->depth > 0 && ($isMediaOrDirective || ! $this->hasFlatChild($block))) { |
|
| 169 | + if (!empty($block->children)) { |
|
| 170 | + if ($this->depth > 0 && ($isMediaOrDirective || !$this->hasFlatChild($block))) { |
|
| 171 | 171 | array_pop($depths); |
| 172 | 172 | |
| 173 | 173 | $this->depth--; |
@@ -185,10 +185,10 @@ discard block |
||
| 185 | 185 | $previousHasSelector = false; |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | - if (! empty($block->selectors)) { |
|
| 188 | + if (!empty($block->selectors)) { |
|
| 189 | 189 | $this->indentLevel--; |
| 190 | 190 | |
| 191 | - if (! $this->keepSemicolons) { |
|
| 191 | + if (!$this->keepSemicolons) { |
|
| 192 | 192 | $this->strippedSemicolon = ''; |
| 193 | 193 | } |
| 194 | 194 | |
@@ -196,12 +196,12 @@ discard block |
||
| 196 | 196 | |
| 197 | 197 | $closeBlock = $this->break; |
| 198 | 198 | |
| 199 | - if ($this->depth > 1 && ! empty($block->children)) { |
|
| 199 | + if ($this->depth > 1 && !empty($block->children)) { |
|
| 200 | 200 | array_pop($depths); |
| 201 | 201 | $this->depth--; |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | - if (! $isMediaOrDirective) { |
|
| 204 | + if (!$isMediaOrDirective) { |
|
| 205 | 205 | $previousHasSelector = true; |
| 206 | 206 | } |
| 207 | 207 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | |
| 55 | 55 | $this->write($inner . implode($glue, $block->lines)); |
| 56 | 56 | |
| 57 | - if (! empty($block->children)) { |
|
| 57 | + if (!empty($block->children)) { |
|
| 58 | 58 | $this->write($this->break); |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | |
| 57 | 57 | $this->write($inner . implode($glue, $block->lines)); |
| 58 | 58 | |
| 59 | - if (! empty($block->children)) { |
|
| 59 | + if (!empty($block->children)) { |
|
| 60 | 60 | $this->write($this->break); |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -233,7 +233,7 @@ discard block |
||
| 233 | 233 | if (\is_array($cache) && isset($cache['dependencies']) && isset($cache['out'])) { |
| 234 | 234 | // check if any dependency file changed before accepting the cache |
| 235 | 235 | foreach ($cache['dependencies'] as $file => $mtime) { |
| 236 | - if (! is_file($file) || filemtime($file) !== $mtime) { |
|
| 236 | + if (!is_file($file) || filemtime($file) !== $mtime) { |
|
| 237 | 237 | unset($cache); |
| 238 | 238 | break; |
| 239 | 239 | } |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | |
| 285 | 285 | $out = $this->formatter->format($this->scope, $sourceMapGenerator); |
| 286 | 286 | |
| 287 | - if (! empty($out) && $this->sourceMap && $this->sourceMap !== self::SOURCE_MAP_NONE) { |
|
| 287 | + if (!empty($out) && $this->sourceMap && $this->sourceMap !== self::SOURCE_MAP_NONE) { |
|
| 288 | 288 | $sourceMap = $sourceMapGenerator->generateJson(); |
| 289 | 289 | $sourceMapUrl = null; |
| 290 | 290 | |
@@ -465,22 +465,22 @@ discard block |
||
| 465 | 465 | foreach ($block->selectors as $s) { |
| 466 | 466 | $selectors[] = $s; |
| 467 | 467 | |
| 468 | - if (! \is_array($s)) { |
|
| 468 | + if (!\is_array($s)) { |
|
| 469 | 469 | continue; |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | // check extends |
| 473 | - if (! empty($this->extendsMap)) { |
|
| 473 | + if (!empty($this->extendsMap)) { |
|
| 474 | 474 | $this->matchExtends($s, $selectors); |
| 475 | 475 | |
| 476 | 476 | // remove duplicates |
| 477 | - array_walk($selectors, function (&$value) { |
|
| 477 | + array_walk($selectors, function(&$value) { |
|
| 478 | 478 | $value = serialize($value); |
| 479 | 479 | }); |
| 480 | 480 | |
| 481 | 481 | $selectors = array_unique($selectors); |
| 482 | 482 | |
| 483 | - array_walk($selectors, function (&$value) { |
|
| 483 | + array_walk($selectors, function(&$value) { |
|
| 484 | 484 | $value = unserialize($value); |
| 485 | 485 | }); |
| 486 | 486 | } |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | // if the new part is just including a previous part don't try to extend anymore |
| 574 | 574 | if (\count($part) > 1) { |
| 575 | 575 | foreach ($partsPile as $previousPart) { |
| 576 | - if (! \count(array_diff($previousPart, $part))) { |
|
| 576 | + if (!\count(array_diff($previousPart, $part))) { |
|
| 577 | 577 | continue 2; |
| 578 | 578 | } |
| 579 | 579 | } |
@@ -607,14 +607,14 @@ discard block |
||
| 607 | 607 | $slice = []; |
| 608 | 608 | |
| 609 | 609 | foreach ($tempReplacement[$l] as $chunk) { |
| 610 | - if (! \in_array($chunk, $slice)) { |
|
| 610 | + if (!\in_array($chunk, $slice)) { |
|
| 611 | 611 | $slice[] = $chunk; |
| 612 | 612 | } |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | array_unshift($replacement, $slice); |
| 616 | 616 | |
| 617 | - if (! $this->isImmediateRelationshipCombinator(end($slice))) { |
|
| 617 | + if (!$this->isImmediateRelationshipCombinator(end($slice))) { |
|
| 618 | 618 | break; |
| 619 | 619 | } |
| 620 | 620 | } |
@@ -647,7 +647,7 @@ discard block |
||
| 647 | 647 | } |
| 648 | 648 | |
| 649 | 649 | // selector sequence merging |
| 650 | - if (! empty($before) && \count($new) > 1) { |
|
| 650 | + if (!empty($before) && \count($new) > 1) { |
|
| 651 | 651 | $preSharedParts = $k > 0 ? \array_slice($before, 0, $k) : []; |
| 652 | 652 | $postSharedParts = $k > 0 ? \array_slice($before, $k) : $before; |
| 653 | 653 | |
@@ -714,7 +714,7 @@ discard block |
||
| 714 | 714 | |
| 715 | 715 | if ( |
| 716 | 716 | $this->isPseudoSelector($part, $matchesExtended) && |
| 717 | - \in_array($matchesExtended[1], [ 'slotted' ]) |
|
| 717 | + \in_array($matchesExtended[1], ['slotted']) |
|
| 718 | 718 | ) { |
| 719 | 719 | $prev = end($out); |
| 720 | 720 | $prev = $this->glueFunctionSelectors($prev); |
@@ -730,7 +730,7 @@ discard block |
||
| 730 | 730 | $extended = explode($matchesExtended[1] . '(', $matchesExtended[0], 2); |
| 731 | 731 | $extended[1] = $matchesPrev[2] . ', ' . $extended[1]; |
| 732 | 732 | $extended = implode($matchesExtended[1] . '(', $extended); |
| 733 | - $extended = [ [ $extended ]]; |
|
| 733 | + $extended = [[$extended]]; |
|
| 734 | 734 | array_pop($out); |
| 735 | 735 | } |
| 736 | 736 | } |
@@ -754,17 +754,17 @@ discard block |
||
| 754 | 754 | $single = []; |
| 755 | 755 | |
| 756 | 756 | // simple usual cases, no need to do the whole trick |
| 757 | - if (\in_array($rawSingle, [['>'],['+'],['~']])) { |
|
| 757 | + if (\in_array($rawSingle, [['>'], ['+'], ['~']])) { |
|
| 758 | 758 | return false; |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | foreach ($rawSingle as $part) { |
| 762 | 762 | // matches Number |
| 763 | - if (! \is_string($part)) { |
|
| 763 | + if (!\is_string($part)) { |
|
| 764 | 764 | return false; |
| 765 | 765 | } |
| 766 | 766 | |
| 767 | - if (! preg_match('/^[\[.:#%]/', $part) && \count($single)) { |
|
| 767 | + if (!preg_match('/^[\[.:#%]/', $part) && \count($single)) { |
|
| 768 | 768 | $single[\count($single) - 1] .= $part; |
| 769 | 769 | } else { |
| 770 | 770 | $single[] = $part; |
@@ -791,7 +791,7 @@ discard block |
||
| 791 | 791 | if ( |
| 792 | 792 | $initial && |
| 793 | 793 | $this->isPseudoSelector($part, $matches) && |
| 794 | - ! \in_array($matches[1], [ 'not' ]) |
|
| 794 | + !\in_array($matches[1], ['not']) |
|
| 795 | 795 | ) { |
| 796 | 796 | $buffer = $matches[2]; |
| 797 | 797 | $parser = $this->parserFactory(__METHOD__); |
@@ -812,7 +812,7 @@ discard block |
||
| 812 | 812 | $subSelectorsExtended = implode(', ', $subSelectorsExtended); |
| 813 | 813 | $singleExtended = $single; |
| 814 | 814 | $singleExtended[$k] = str_replace('(' . $buffer . ')', "($subSelectorsExtended)", $part); |
| 815 | - $outOrigin[] = [ $singleExtended ]; |
|
| 815 | + $outOrigin[] = [$singleExtended]; |
|
| 816 | 816 | $found = true; |
| 817 | 817 | } |
| 818 | 818 | } |
@@ -836,7 +836,7 @@ discard block |
||
| 836 | 836 | |
| 837 | 837 | foreach ($origin as $j => $new) { |
| 838 | 838 | // prevent infinite loop when target extends itself |
| 839 | - if ($this->isSelfExtend($single, $origin) && ! $initial) { |
|
| 839 | + if ($this->isSelfExtend($single, $origin) && !$initial) { |
|
| 840 | 840 | return false; |
| 841 | 841 | } |
| 842 | 842 | |
@@ -890,7 +890,7 @@ discard block |
||
| 890 | 890 | $parents = \array_slice($fragment, 0, $j); |
| 891 | 891 | $slice = end($parents); |
| 892 | 892 | |
| 893 | - if (empty($slice) || ! $this->isImmediateRelationshipCombinator($slice[0])) { |
|
| 893 | + if (empty($slice) || !$this->isImmediateRelationshipCombinator($slice[0])) { |
|
| 894 | 894 | break; |
| 895 | 895 | } |
| 896 | 896 | |
@@ -963,7 +963,7 @@ discard block |
||
| 963 | 963 | |
| 964 | 964 | $mediaQueries = $this->compileMediaQuery($this->multiplyMedia($this->env)); |
| 965 | 965 | |
| 966 | - if (! empty($mediaQueries) && $mediaQueries) { |
|
| 966 | + if (!empty($mediaQueries) && $mediaQueries) { |
|
| 967 | 967 | $previousScope = $this->scope; |
| 968 | 968 | $parentScope = $this->mediaParent($this->scope); |
| 969 | 969 | |
@@ -1046,8 +1046,8 @@ discard block |
||
| 1046 | 1046 | */ |
| 1047 | 1047 | protected function mediaParent(OutputBlock $scope) |
| 1048 | 1048 | { |
| 1049 | - while (! empty($scope->parent)) { |
|
| 1050 | - if (! empty($scope->type) && $scope->type !== Type::T_MEDIA) { |
|
| 1049 | + while (!empty($scope->parent)) { |
|
| 1050 | + if (!empty($scope->type) && $scope->type !== Type::T_MEDIA) { |
|
| 1051 | 1051 | break; |
| 1052 | 1052 | } |
| 1053 | 1053 | |
@@ -1068,7 +1068,7 @@ discard block |
||
| 1068 | 1068 | if (\is_array($directive)) { |
| 1069 | 1069 | $s = '@' . $directive[0]; |
| 1070 | 1070 | |
| 1071 | - if (! empty($directive[1])) { |
|
| 1071 | + if (!empty($directive[1])) { |
|
| 1072 | 1072 | $s .= ' ' . $this->compileValue($directive[1]); |
| 1073 | 1073 | } |
| 1074 | 1074 | |
@@ -1076,7 +1076,7 @@ discard block |
||
| 1076 | 1076 | } else { |
| 1077 | 1077 | $s = '@' . $directive->name; |
| 1078 | 1078 | |
| 1079 | - if (! empty($directive->value)) { |
|
| 1079 | + if (!empty($directive->value)) { |
|
| 1080 | 1080 | $s .= ' ' . $this->compileValue($directive->value); |
| 1081 | 1081 | } |
| 1082 | 1082 | |
@@ -1119,7 +1119,7 @@ discard block |
||
| 1119 | 1119 | $selfParent = $block->selfParent; |
| 1120 | 1120 | |
| 1121 | 1121 | if ( |
| 1122 | - ! $block->selfParent->selectors && |
|
| 1122 | + !$block->selfParent->selectors && |
|
| 1123 | 1123 | isset($block->parent) && $block->parent && |
| 1124 | 1124 | isset($block->parent->selectors) && $block->parent->selectors |
| 1125 | 1125 | ) { |
@@ -1166,7 +1166,7 @@ discard block |
||
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | for (;;) { |
| 1169 | - if (! $scope) { |
|
| 1169 | + if (!$scope) { |
|
| 1170 | 1170 | break; |
| 1171 | 1171 | } |
| 1172 | 1172 | |
@@ -1192,7 +1192,7 @@ discard block |
||
| 1192 | 1192 | } |
| 1193 | 1193 | } |
| 1194 | 1194 | |
| 1195 | - if (! \count($filteredScopes)) { |
|
| 1195 | + if (!\count($filteredScopes)) { |
|
| 1196 | 1196 | return $this->rootBlock; |
| 1197 | 1197 | } |
| 1198 | 1198 | |
@@ -1225,7 +1225,7 @@ discard block |
||
| 1225 | 1225 | */ |
| 1226 | 1226 | protected function completeScope($scope, $previousScope) |
| 1227 | 1227 | { |
| 1228 | - if (! $scope->type && (! $scope->selectors || ! \count($scope->selectors)) && \count($scope->lines)) { |
|
| 1228 | + if (!$scope->type && (!$scope->selectors || !\count($scope->selectors)) && \count($scope->lines)) { |
|
| 1229 | 1229 | $scope->selectors = $this->findScopeSelectors($previousScope, $scope->depth); |
| 1230 | 1230 | } |
| 1231 | 1231 | |
@@ -1328,7 +1328,7 @@ discard block |
||
| 1328 | 1328 | $filtered = []; |
| 1329 | 1329 | |
| 1330 | 1330 | foreach ($envs as $e) { |
| 1331 | - if ($e->block && ! $this->isWith($e->block, $with, $without)) { |
|
| 1331 | + if ($e->block && !$this->isWith($e->block, $with, $without)) { |
|
| 1332 | 1332 | $ec = clone $e; |
| 1333 | 1333 | $ec->block = null; |
| 1334 | 1334 | $ec->selectors = []; |
@@ -1421,8 +1421,8 @@ discard block |
||
| 1421 | 1421 | |
| 1422 | 1422 | $envs = $this->compactEnv($env); |
| 1423 | 1423 | |
| 1424 | - $this->env = $this->extractEnv(array_filter($envs, function (Environment $e) { |
|
| 1425 | - return ! isset($e->block->selectors); |
|
| 1424 | + $this->env = $this->extractEnv(array_filter($envs, function(Environment $e) { |
|
| 1425 | + return !isset($e->block->selectors); |
|
| 1426 | 1426 | })); |
| 1427 | 1427 | |
| 1428 | 1428 | $this->scope = $this->makeOutputBlock($block->type, $selectors); |
@@ -1734,7 +1734,7 @@ discard block |
||
| 1734 | 1734 | |
| 1735 | 1735 | array_walk_recursive( |
| 1736 | 1736 | $node, |
| 1737 | - function ($value, $key) use (&$compound) { |
|
| 1737 | + function($value, $key) use (&$compound) { |
|
| 1738 | 1738 | $compound .= $value; |
| 1739 | 1739 | } |
| 1740 | 1740 | ); |
@@ -1817,7 +1817,7 @@ discard block |
||
| 1817 | 1817 | foreach ($single as $part) { |
| 1818 | 1818 | if ( |
| 1819 | 1819 | empty($joined) || |
| 1820 | - ! \is_string($part) || |
|
| 1820 | + !\is_string($part) || |
|
| 1821 | 1821 | preg_match('/[\[.:#%]/', $part) |
| 1822 | 1822 | ) { |
| 1823 | 1823 | $joined[] = $part; |
@@ -1843,7 +1843,7 @@ discard block |
||
| 1843 | 1843 | */ |
| 1844 | 1844 | protected function compileSelector($selector) |
| 1845 | 1845 | { |
| 1846 | - if (! \is_array($selector)) { |
|
| 1846 | + if (!\is_array($selector)) { |
|
| 1847 | 1847 | return $selector; // media and the like |
| 1848 | 1848 | } |
| 1849 | 1849 | |
@@ -1866,7 +1866,7 @@ discard block |
||
| 1866 | 1866 | protected function compileSelectorPart($piece) |
| 1867 | 1867 | { |
| 1868 | 1868 | foreach ($piece as &$p) { |
| 1869 | - if (! \is_array($p)) { |
|
| 1869 | + if (!\is_array($p)) { |
|
| 1870 | 1870 | continue; |
| 1871 | 1871 | } |
| 1872 | 1872 | |
@@ -1893,7 +1893,7 @@ discard block |
||
| 1893 | 1893 | */ |
| 1894 | 1894 | protected function hasSelectorPlaceholder($selector) |
| 1895 | 1895 | { |
| 1896 | - if (! \is_array($selector)) { |
|
| 1896 | + if (!\is_array($selector)) { |
|
| 1897 | 1897 | return false; |
| 1898 | 1898 | } |
| 1899 | 1899 | |
@@ -2095,13 +2095,13 @@ discard block |
||
| 2095 | 2095 | $newType = array_map([$this, 'compileValue'], \array_slice($q, 1)); |
| 2096 | 2096 | |
| 2097 | 2097 | // combining not and anything else than media type is too risky and should be avoided |
| 2098 | - if (! $mediaTypeOnly) { |
|
| 2099 | - if (\in_array(Type::T_NOT, $newType) || ($type && \in_array(Type::T_NOT, $type) )) { |
|
| 2098 | + if (!$mediaTypeOnly) { |
|
| 2099 | + if (\in_array(Type::T_NOT, $newType) || ($type && \in_array(Type::T_NOT, $type))) { |
|
| 2100 | 2100 | if ($type) { |
| 2101 | 2101 | array_unshift($parts, implode(' ', array_filter($type))); |
| 2102 | 2102 | } |
| 2103 | 2103 | |
| 2104 | - if (! empty($parts)) { |
|
| 2104 | + if (!empty($parts)) { |
|
| 2105 | 2105 | if (\strlen($current)) { |
| 2106 | 2106 | $current .= $this->formatter->tagSeparator; |
| 2107 | 2107 | } |
@@ -2164,7 +2164,7 @@ discard block |
||
| 2164 | 2164 | array_unshift($parts, implode(' ', array_filter($type))); |
| 2165 | 2165 | } |
| 2166 | 2166 | |
| 2167 | - if (! empty($parts)) { |
|
| 2167 | + if (!empty($parts)) { |
|
| 2168 | 2168 | if (\strlen($current)) { |
| 2169 | 2169 | $current .= $this->formatter->tagSeparator; |
| 2170 | 2170 | } |
@@ -2178,7 +2178,7 @@ discard block |
||
| 2178 | 2178 | } |
| 2179 | 2179 | |
| 2180 | 2180 | // no @media type except all, and no conflict? |
| 2181 | - if (! $out && $default) { |
|
| 2181 | + if (!$out && $default) { |
|
| 2182 | 2182 | $out[] = $default; |
| 2183 | 2183 | } |
| 2184 | 2184 | |
@@ -2202,7 +2202,7 @@ discard block |
||
| 2202 | 2202 | $part1 = end($selectors1); |
| 2203 | 2203 | $part2 = end($selectors2); |
| 2204 | 2204 | |
| 2205 | - if (! $this->isImmediateRelationshipCombinator($part1[0]) && $part1 !== $part2) { |
|
| 2205 | + if (!$this->isImmediateRelationshipCombinator($part1[0]) && $part1 !== $part2) { |
|
| 2206 | 2206 | return array_merge($selectors1, $selectors2); |
| 2207 | 2207 | } |
| 2208 | 2208 | |
@@ -2212,7 +2212,7 @@ discard block |
||
| 2212 | 2212 | $part1 = array_pop($selectors1); |
| 2213 | 2213 | $part2 = array_pop($selectors2); |
| 2214 | 2214 | |
| 2215 | - if (! $this->isImmediateRelationshipCombinator($part1[0]) && $part1 !== $part2) { |
|
| 2215 | + if (!$this->isImmediateRelationshipCombinator($part1[0]) && $part1 !== $part2) { |
|
| 2216 | 2216 | if ($this->isImmediateRelationshipCombinator(reset($merged)[0])) { |
| 2217 | 2217 | array_unshift($merged, [$part1[0] . $part2[0]]); |
| 2218 | 2218 | $merged = array_merge($selectors1, $selectors2, $merged); |
@@ -2224,7 +2224,7 @@ discard block |
||
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | 2226 | array_unshift($merged, $part1); |
| 2227 | - } while (! empty($selectors1) && ! empty($selectors2)); |
|
| 2227 | + } while (!empty($selectors1) && !empty($selectors2)); |
|
| 2228 | 2228 | |
| 2229 | 2229 | return $merged; |
| 2230 | 2230 | } |
@@ -2306,7 +2306,7 @@ discard block |
||
| 2306 | 2306 | $path = $this->compileStringContent($rawPath); |
| 2307 | 2307 | |
| 2308 | 2308 | if (strpos($path, 'url(') !== 0 && $path = $this->findImport($path)) { |
| 2309 | - if (! $once || ! \in_array($path, $this->importedFiles)) { |
|
| 2309 | + if (!$once || !\in_array($path, $this->importedFiles)) { |
|
| 2310 | 2310 | $this->importFile($path, $out); |
| 2311 | 2311 | $this->importedFiles[] = $path; |
| 2312 | 2312 | } |
@@ -2412,7 +2412,7 @@ discard block |
||
| 2412 | 2412 | $i = 0; |
| 2413 | 2413 | |
| 2414 | 2414 | while ($i < \count($root->children)) { |
| 2415 | - if (! isset($root->children[$i]->type) || ! \in_array($root->children[$i]->type, $allowed)) { |
|
| 2415 | + if (!isset($root->children[$i]->type) || !\in_array($root->children[$i]->type, $allowed)) { |
|
| 2416 | 2416 | break; |
| 2417 | 2417 | } |
| 2418 | 2418 | |
@@ -2460,7 +2460,7 @@ discard block |
||
| 2460 | 2460 | if ( |
| 2461 | 2461 | $lastChild->depth === $out->depth && |
| 2462 | 2462 | \is_null($lastChild->selectors) && |
| 2463 | - ! \count($lastChild->children) |
|
| 2463 | + !\count($lastChild->children) |
|
| 2464 | 2464 | ) { |
| 2465 | 2465 | $outWrite = $lastChild; |
| 2466 | 2466 | } else { |
@@ -2494,7 +2494,7 @@ discard block |
||
| 2494 | 2494 | $this->sourceIndex = $child[1]->sourceIndex; |
| 2495 | 2495 | $this->sourceLine = $child[1]->sourceLine; |
| 2496 | 2496 | $this->sourceColumn = $child[1]->sourceColumn; |
| 2497 | - } elseif (! empty($out->sourceLine) && ! empty($out->sourceName)) { |
|
| 2497 | + } elseif (!empty($out->sourceLine) && !empty($out->sourceName)) { |
|
| 2498 | 2498 | $this->sourceLine = $out->sourceLine; |
| 2499 | 2499 | $this->sourceIndex = array_search($out->sourceName, $this->sourceNames); |
| 2500 | 2500 | $this->sourceColumn = $out->sourceColumn; |
@@ -2534,7 +2534,7 @@ discard block |
||
| 2534 | 2534 | break; |
| 2535 | 2535 | |
| 2536 | 2536 | case Type::T_CHARSET: |
| 2537 | - if (! $this->charsetSeen) { |
|
| 2537 | + if (!$this->charsetSeen) { |
|
| 2538 | 2538 | $this->charsetSeen = true; |
| 2539 | 2539 | $this->appendRootDirective('@charset ' . $this->compileValue($child[1]) . ';', $out); |
| 2540 | 2540 | } |
@@ -2581,7 +2581,7 @@ discard block |
||
| 2581 | 2581 | (\is_null($result = $this->get($name[1], false)) || |
| 2582 | 2582 | $result === static::$null); |
| 2583 | 2583 | |
| 2584 | - if (! $isDefault || $shouldSet) { |
|
| 2584 | + if (!$isDefault || $shouldSet) { |
|
| 2585 | 2585 | $this->set($name[1], $this->reduce($value), true, null, $value); |
| 2586 | 2586 | } |
| 2587 | 2587 | break; |
@@ -2597,7 +2597,7 @@ discard block |
||
| 2597 | 2597 | $value = $this->get($value[1], true, null, true); |
| 2598 | 2598 | } |
| 2599 | 2599 | |
| 2600 | - $shorthandValue=&$value; |
|
| 2600 | + $shorthandValue = &$value; |
|
| 2601 | 2601 | |
| 2602 | 2602 | $shorthandDividerNeedsUnit = false; |
| 2603 | 2603 | $maxListElements = null; |
@@ -2613,7 +2613,7 @@ discard block |
||
| 2613 | 2613 | if ($compiledName === 'font' && $value[0] === Type::T_LIST && $value[1] === ',') { |
| 2614 | 2614 | // this is the case if more than one font is given: example: "font: 400 1em/1.3 arial,helvetica" |
| 2615 | 2615 | // we need to handle the first list element |
| 2616 | - $shorthandValue=&$value[2][0]; |
|
| 2616 | + $shorthandValue = &$value[2][0]; |
|
| 2617 | 2617 | } |
| 2618 | 2618 | |
| 2619 | 2619 | if ($shorthandValue[0] === Type::T_EXPRESSION && $shorthandValue[1] === '/') { |
@@ -2626,7 +2626,7 @@ discard block |
||
| 2626 | 2626 | $divider = $this->reduce($divider, true); |
| 2627 | 2627 | } |
| 2628 | 2628 | |
| 2629 | - if (\intval($divider->dimension) && ! \count($divider->units)) { |
|
| 2629 | + if (\intval($divider->dimension) && !\count($divider->units)) { |
|
| 2630 | 2630 | $revert = false; |
| 2631 | 2631 | } |
| 2632 | 2632 | } |
@@ -2650,7 +2650,7 @@ discard block |
||
| 2650 | 2650 | $divider = $this->reduce($divider, true); |
| 2651 | 2651 | } |
| 2652 | 2652 | |
| 2653 | - if (\intval($divider->dimension) && ! \count($divider->units)) { |
|
| 2653 | + if (\intval($divider->dimension) && !\count($divider->units)) { |
|
| 2654 | 2654 | $revert = false; |
| 2655 | 2655 | } |
| 2656 | 2656 | } |
@@ -2716,7 +2716,7 @@ discard block |
||
| 2716 | 2716 | $result = current($result); |
| 2717 | 2717 | $selectors = $out->selectors; |
| 2718 | 2718 | |
| 2719 | - if (! $selectors && isset($child['selfParent'])) { |
|
| 2719 | + if (!$selectors && isset($child['selfParent'])) { |
|
| 2720 | 2720 | $selectors = $this->multiplySelectors($this->env, $child['selfParent']); |
| 2721 | 2721 | } |
| 2722 | 2722 | |
@@ -2806,15 +2806,15 @@ discard block |
||
| 2806 | 2806 | $start = $this->reduce($for->start, true); |
| 2807 | 2807 | $end = $this->reduce($for->end, true); |
| 2808 | 2808 | |
| 2809 | - if (! $start instanceof Node\Number) { |
|
| 2809 | + if (!$start instanceof Node\Number) { |
|
| 2810 | 2810 | throw $this->error('%s is not a number', $start[0]); |
| 2811 | 2811 | } |
| 2812 | 2812 | |
| 2813 | - if (! $end instanceof Node\Number) { |
|
| 2813 | + if (!$end instanceof Node\Number) { |
|
| 2814 | 2814 | throw $this->error('%s is not a number', $end[0]); |
| 2815 | 2815 | } |
| 2816 | 2816 | |
| 2817 | - if (! ($start[2] == $end[2] || $end->unitless())) { |
|
| 2817 | + if (!($start[2] == $end[2] || $end->unitless())) { |
|
| 2818 | 2818 | throw $this->error('Incompatible units: "%s" && "%s".', $start->unitStr(), $end->unitStr()); |
| 2819 | 2819 | } |
| 2820 | 2820 | |
@@ -2828,7 +2828,7 @@ discard block |
||
| 2828 | 2828 | |
| 2829 | 2829 | for (;;) { |
| 2830 | 2830 | if ( |
| 2831 | - (! $for->until && $start - $d == $end) || |
|
| 2831 | + (!$for->until && $start - $d == $end) || |
|
| 2832 | 2832 | ($for->until && $start == $end) |
| 2833 | 2833 | ) { |
| 2834 | 2834 | break; |
@@ -2879,7 +2879,7 @@ discard block |
||
| 2879 | 2879 | |
| 2880 | 2880 | $mixin = $this->get(static::$namespaces['mixin'] . $name, false); |
| 2881 | 2881 | |
| 2882 | - if (! $mixin) { |
|
| 2882 | + if (!$mixin) { |
|
| 2883 | 2883 | throw $this->error("Undefined mixin $name"); |
| 2884 | 2884 | } |
| 2885 | 2885 | |
@@ -2934,7 +2934,7 @@ discard block |
||
| 2934 | 2934 | |
| 2935 | 2935 | $this->env->marker = 'mixin'; |
| 2936 | 2936 | |
| 2937 | - if (! empty($mixin->parentEnv)) { |
|
| 2937 | + if (!empty($mixin->parentEnv)) { |
|
| 2938 | 2938 | $this->env->declarationScopeParent = $mixin->parentEnv; |
| 2939 | 2939 | } else { |
| 2940 | 2940 | throw $this->error("@mixin $name() without parentEnv"); |
@@ -2951,7 +2951,7 @@ discard block |
||
| 2951 | 2951 | $argUsing = $this->get(static::$namespaces['special'] . 'using', false, $env); |
| 2952 | 2952 | $argContent = $child[1]; |
| 2953 | 2953 | |
| 2954 | - if (! $content) { |
|
| 2954 | + if (!$content) { |
|
| 2955 | 2955 | break; |
| 2956 | 2956 | } |
| 2957 | 2957 | |
@@ -3119,9 +3119,9 @@ discard block |
||
| 3119 | 3119 | |
| 3120 | 3120 | // special case: looks like css shorthand |
| 3121 | 3121 | if ( |
| 3122 | - $opName == 'div' && ! $inParens && ! $inExp && isset($right[2]) && |
|
| 3122 | + $opName == 'div' && !$inParens && !$inExp && isset($right[2]) && |
|
| 3123 | 3123 | (($right[0] !== Type::T_NUMBER && $right[2] != '') || |
| 3124 | - ($right[0] === Type::T_NUMBER && ! $right->unitless())) |
|
| 3124 | + ($right[0] === Type::T_NUMBER && !$right->unitless())) |
|
| 3125 | 3125 | ) { |
| 3126 | 3126 | return $this->expToString($value); |
| 3127 | 3127 | } |
@@ -3153,7 +3153,7 @@ discard block |
||
| 3153 | 3153 | $coerceUnit = false; |
| 3154 | 3154 | |
| 3155 | 3155 | if ( |
| 3156 | - ! isset($genOp) && |
|
| 3156 | + !isset($genOp) && |
|
| 3157 | 3157 | $left[0] === Type::T_NUMBER && $right[0] === Type::T_NUMBER |
| 3158 | 3158 | ) { |
| 3159 | 3159 | $coerceUnit = true; |
@@ -3286,7 +3286,7 @@ discard block |
||
| 3286 | 3286 | return $this->fncall($value[1], $value[2]); |
| 3287 | 3287 | |
| 3288 | 3288 | case Type::T_SELF: |
| 3289 | - $selfParent = ! empty($this->env->block->selfParent) ? $this->env->block->selfParent : null; |
|
| 3289 | + $selfParent = !empty($this->env->block->selfParent) ? $this->env->block->selfParent : null; |
|
| 3290 | 3290 | $selfSelector = $this->multiplySelectors($this->env, $selfParent); |
| 3291 | 3291 | $selfSelector = $this->collapseSelectors($selfSelector, true); |
| 3292 | 3292 | |
@@ -3344,10 +3344,10 @@ discard block |
||
| 3344 | 3344 | // native PHP functions |
| 3345 | 3345 | case 'user': |
| 3346 | 3346 | case 'native': |
| 3347 | - list(,,$name, $fn, $prototype) = $functionReference; |
|
| 3347 | + list(,, $name, $fn, $prototype) = $functionReference; |
|
| 3348 | 3348 | $returnValue = $this->callNativeFunction($name, $fn, $prototype, $argValues); |
| 3349 | 3349 | |
| 3350 | - if (! isset($returnValue)) { |
|
| 3350 | + if (!isset($returnValue)) { |
|
| 3351 | 3351 | return $this->fncall([Type::T_FUNCTION, $name, [Type::T_LIST, ',', []]], $argValues); |
| 3352 | 3352 | } |
| 3353 | 3353 | |
@@ -3471,7 +3471,7 @@ discard block |
||
| 3471 | 3471 | $value[2][$key] = $this->normalizeValue($item); |
| 3472 | 3472 | } |
| 3473 | 3473 | |
| 3474 | - if (! empty($value['enclosing'])) { |
|
| 3474 | + if (!empty($value['enclosing'])) { |
|
| 3475 | 3475 | unset($value['enclosing']); |
| 3476 | 3476 | } |
| 3477 | 3477 | |
@@ -3612,8 +3612,8 @@ discard block |
||
| 3612 | 3612 | ($left === static::$false || $left === static::$true) && |
| 3613 | 3613 | ($right === static::$false || $right === static::$true); |
| 3614 | 3614 | |
| 3615 | - if (! $shouldEval) { |
|
| 3616 | - if (! $truthy) { |
|
| 3615 | + if (!$shouldEval) { |
|
| 3616 | + if (!$truthy) { |
|
| 3617 | 3617 | return null; |
| 3618 | 3618 | } |
| 3619 | 3619 | } |
@@ -3640,8 +3640,8 @@ discard block |
||
| 3640 | 3640 | ($left === static::$false || $left === static::$true) && |
| 3641 | 3641 | ($right === static::$false || $right === static::$true); |
| 3642 | 3642 | |
| 3643 | - if (! $shouldEval) { |
|
| 3644 | - if (! $truthy) { |
|
| 3643 | + if (!$shouldEval) { |
|
| 3644 | + if (!$truthy) { |
|
| 3645 | 3645 | return null; |
| 3646 | 3646 | } |
| 3647 | 3647 | } |
@@ -3921,10 +3921,10 @@ discard block |
||
| 3921 | 3921 | if (\count($value) === 5) { |
| 3922 | 3922 | $alpha = $this->compileRGBAValue($value[4], true); |
| 3923 | 3923 | |
| 3924 | - if (! is_numeric($alpha) || $alpha < 1) { |
|
| 3924 | + if (!is_numeric($alpha) || $alpha < 1) { |
|
| 3925 | 3925 | $colorName = Colors::RGBaToColorName($r, $g, $b, $alpha); |
| 3926 | 3926 | |
| 3927 | - if (! \is_null($colorName)) { |
|
| 3927 | + if (!\is_null($colorName)) { |
|
| 3928 | 3928 | return $colorName; |
| 3929 | 3929 | } |
| 3930 | 3930 | |
@@ -3938,13 +3938,13 @@ discard block |
||
| 3938 | 3938 | } |
| 3939 | 3939 | } |
| 3940 | 3940 | |
| 3941 | - if (! is_numeric($r) || ! is_numeric($g) || ! is_numeric($b)) { |
|
| 3941 | + if (!is_numeric($r) || !is_numeric($g) || !is_numeric($b)) { |
|
| 3942 | 3942 | return 'rgb(' . $r . ', ' . $g . ', ' . $b . ')'; |
| 3943 | 3943 | } |
| 3944 | 3944 | |
| 3945 | 3945 | $colorName = Colors::RGBaToColorName($r, $g, $b); |
| 3946 | 3946 | |
| 3947 | - if (! \is_null($colorName)) { |
|
| 3947 | + if (!\is_null($colorName)) { |
|
| 3948 | 3948 | return $colorName; |
| 3949 | 3949 | } |
| 3950 | 3950 | |
@@ -3973,8 +3973,8 @@ discard block |
||
| 3973 | 3973 | $value[1] = '"'; |
| 3974 | 3974 | } |
| 3975 | 3975 | $content = str_replace( |
| 3976 | - array('\\a', "\n", "\f" , '\\' , "\r" , $value[1]), |
|
| 3977 | - array("\r" , ' ' , '\\f', '\\\\', '\\a', '\\' . $value[1]), |
|
| 3976 | + array('\\a', "\n", "\f", '\\', "\r", $value[1]), |
|
| 3977 | + array("\r", ' ', '\\f', '\\\\', '\\a', '\\' . $value[1]), |
|
| 3978 | 3978 | $content |
| 3979 | 3979 | ); |
| 3980 | 3980 | } |
@@ -3982,12 +3982,12 @@ discard block |
||
| 3982 | 3982 | return $value[1] . $content . $value[1]; |
| 3983 | 3983 | |
| 3984 | 3984 | case Type::T_FUNCTION: |
| 3985 | - $args = ! empty($value[2]) ? $this->compileValue($value[2]) : ''; |
|
| 3985 | + $args = !empty($value[2]) ? $this->compileValue($value[2]) : ''; |
|
| 3986 | 3986 | |
| 3987 | 3987 | return "$value[1]($args)"; |
| 3988 | 3988 | |
| 3989 | 3989 | case Type::T_FUNCTION_REFERENCE: |
| 3990 | - $name = ! empty($value[2]) ? $value[2] : ''; |
|
| 3990 | + $name = !empty($value[2]) ? $value[2] : ''; |
|
| 3991 | 3991 | |
| 3992 | 3992 | return "get-function(\"$name\")"; |
| 3993 | 3993 | |
@@ -4001,7 +4001,7 @@ discard block |
||
| 4001 | 4001 | list(, $delim, $items) = $value; |
| 4002 | 4002 | $pre = $post = ''; |
| 4003 | 4003 | |
| 4004 | - if (! empty($value['enclosing'])) { |
|
| 4004 | + if (!empty($value['enclosing'])) { |
|
| 4005 | 4005 | switch ($value['enclosing']) { |
| 4006 | 4006 | case 'parent': |
| 4007 | 4007 | //$pre = '('; |
@@ -4052,7 +4052,7 @@ discard block |
||
| 4052 | 4052 | $filtered[$this->compileValue($keys[$i])] = $this->compileValue($values[$i]); |
| 4053 | 4053 | } |
| 4054 | 4054 | |
| 4055 | - array_walk($filtered, function (&$value, $key) { |
|
| 4055 | + array_walk($filtered, function(&$value, $key) { |
|
| 4056 | 4056 | $value = $key . ': ' . $value; |
| 4057 | 4057 | }); |
| 4058 | 4058 | |
@@ -4065,12 +4065,12 @@ discard block |
||
| 4065 | 4065 | |
| 4066 | 4066 | $delim = $left[1]; |
| 4067 | 4067 | |
| 4068 | - if ($delim && $delim !== ' ' && ! $whiteLeft) { |
|
| 4068 | + if ($delim && $delim !== ' ' && !$whiteLeft) { |
|
| 4069 | 4069 | $delim .= ' '; |
| 4070 | 4070 | } |
| 4071 | 4071 | |
| 4072 | 4072 | $left = \count($left[2]) > 0 |
| 4073 | - ? $this->compileValue($left) . $delim . $whiteLeft |
|
| 4073 | + ? $this->compileValue($left) . $delim . $whiteLeft |
|
| 4074 | 4074 | : ''; |
| 4075 | 4075 | |
| 4076 | 4076 | $delim = $right[1]; |
@@ -4235,7 +4235,7 @@ discard block |
||
| 4235 | 4235 | |
| 4236 | 4236 | $selfParentSelectors = null; |
| 4237 | 4237 | |
| 4238 | - if (! \is_null($selfParent) && $selfParent->selectors) { |
|
| 4238 | + if (!\is_null($selfParent) && $selfParent->selectors) { |
|
| 4239 | 4239 | $selfParentSelectors = $this->evalSelectors($selfParent->selectors); |
| 4240 | 4240 | } |
| 4241 | 4241 | |
@@ -4273,7 +4273,7 @@ discard block |
||
| 4273 | 4273 | $selectors = array_values($selectors); |
| 4274 | 4274 | |
| 4275 | 4275 | // case we are just starting a at-root : nothing to multiply but parentSelectors |
| 4276 | - if (! $selectors && $selfParentSelectors) { |
|
| 4276 | + if (!$selectors && $selfParentSelectors) { |
|
| 4277 | 4277 | $selectors = $selfParentSelectors; |
| 4278 | 4278 | } |
| 4279 | 4279 | |
@@ -4304,7 +4304,7 @@ discard block |
||
| 4304 | 4304 | $stillHasSelf = true; |
| 4305 | 4305 | } |
| 4306 | 4306 | |
| 4307 | - if ($p === static::$selfSelector && ! $setSelf) { |
|
| 4307 | + if ($p === static::$selfSelector && !$setSelf) { |
|
| 4308 | 4308 | $setSelf = true; |
| 4309 | 4309 | |
| 4310 | 4310 | if (\is_null($selfParentSelectors)) { |
@@ -4321,7 +4321,7 @@ discard block |
||
| 4321 | 4321 | if (\is_array($pp)) { |
| 4322 | 4322 | $flatten = []; |
| 4323 | 4323 | |
| 4324 | - array_walk_recursive($pp, function ($a) use (&$flatten) { |
|
| 4324 | + array_walk_recursive($pp, function($a) use (&$flatten) { |
|
| 4325 | 4325 | $flatten[] = $a; |
| 4326 | 4326 | }); |
| 4327 | 4327 | |
@@ -4353,8 +4353,8 @@ discard block |
||
| 4353 | 4353 | protected function multiplyMedia(Environment $env = null, $childQueries = null) |
| 4354 | 4354 | { |
| 4355 | 4355 | if ( |
| 4356 | - ! isset($env) || |
|
| 4357 | - ! empty($env->block->type) && $env->block->type !== Type::T_MEDIA |
|
| 4356 | + !isset($env) || |
|
| 4357 | + !empty($env->block->type) && $env->block->type !== Type::T_MEDIA |
|
| 4358 | 4358 | ) { |
| 4359 | 4359 | return $childQueries; |
| 4360 | 4360 | } |
@@ -4469,7 +4469,7 @@ discard block |
||
| 4469 | 4469 | protected function backPropagateEnv($store, $excludedVars = null) |
| 4470 | 4470 | { |
| 4471 | 4471 | foreach ($store as $key => $value) { |
| 4472 | - if (empty($excludedVars) || ! \in_array($key, $excludedVars)) { |
|
| 4472 | + if (empty($excludedVars) || !\in_array($key, $excludedVars)) { |
|
| 4473 | 4473 | $this->set($key, $value, true); |
| 4474 | 4474 | } |
| 4475 | 4475 | } |
@@ -4498,7 +4498,7 @@ discard block |
||
| 4498 | 4498 | { |
| 4499 | 4499 | $name = $this->normalizeName($name); |
| 4500 | 4500 | |
| 4501 | - if (! isset($env)) { |
|
| 4501 | + if (!isset($env)) { |
|
| 4502 | 4502 | $env = $this->getStoreEnv(); |
| 4503 | 4503 | } |
| 4504 | 4504 | |
@@ -4535,13 +4535,13 @@ discard block |
||
| 4535 | 4535 | break; |
| 4536 | 4536 | } |
| 4537 | 4537 | |
| 4538 | - if (! $hasNamespace && isset($env->marker)) { |
|
| 4539 | - if (! empty($env->store[$specialContentKey])) { |
|
| 4538 | + if (!$hasNamespace && isset($env->marker)) { |
|
| 4539 | + if (!empty($env->store[$specialContentKey])) { |
|
| 4540 | 4540 | $env = $env->store[$specialContentKey]->scope; |
| 4541 | 4541 | continue; |
| 4542 | 4542 | } |
| 4543 | 4543 | |
| 4544 | - if (! empty($env->declarationScopeParent)) { |
|
| 4544 | + if (!empty($env->declarationScopeParent)) { |
|
| 4545 | 4545 | $env = $env->declarationScopeParent; |
| 4546 | 4546 | continue; |
| 4547 | 4547 | } else { |
@@ -4601,7 +4601,7 @@ discard block |
||
| 4601 | 4601 | $normalizedName = $this->normalizeName($name); |
| 4602 | 4602 | $specialContentKey = static::$namespaces['special'] . 'content'; |
| 4603 | 4603 | |
| 4604 | - if (! isset($env)) { |
|
| 4604 | + if (!isset($env)) { |
|
| 4605 | 4605 | $env = $this->getStoreEnv(); |
| 4606 | 4606 | } |
| 4607 | 4607 | |
@@ -4622,13 +4622,13 @@ discard block |
||
| 4622 | 4622 | return $env->store[$normalizedName]; |
| 4623 | 4623 | } |
| 4624 | 4624 | |
| 4625 | - if (! $hasNamespace && isset($env->marker)) { |
|
| 4626 | - if (! empty($env->store[$specialContentKey])) { |
|
| 4625 | + if (!$hasNamespace && isset($env->marker)) { |
|
| 4626 | + if (!empty($env->store[$specialContentKey])) { |
|
| 4627 | 4627 | $env = $env->store[$specialContentKey]->scope; |
| 4628 | 4628 | continue; |
| 4629 | 4629 | } |
| 4630 | 4630 | |
| 4631 | - if (! empty($env->declarationScopeParent)) { |
|
| 4631 | + if (!empty($env->declarationScopeParent)) { |
|
| 4632 | 4632 | $env = $env->declarationScopeParent; |
| 4633 | 4633 | } else { |
| 4634 | 4634 | $env = $this->rootEnv; |
@@ -4663,7 +4663,7 @@ discard block |
||
| 4663 | 4663 | */ |
| 4664 | 4664 | protected function has($name, Environment $env = null) |
| 4665 | 4665 | { |
| 4666 | - return ! \is_null($this->get($name, false, $env)); |
|
| 4666 | + return !\is_null($this->get($name, false, $env)); |
|
| 4667 | 4667 | } |
| 4668 | 4668 | |
| 4669 | 4669 | /** |
@@ -4684,7 +4684,7 @@ discard block |
||
| 4684 | 4684 | $name = substr($name, 1); |
| 4685 | 4685 | } |
| 4686 | 4686 | |
| 4687 | - if (! $parser->parseValue($strValue, $value)) { |
|
| 4687 | + if (!$parser->parseValue($strValue, $value)) { |
|
| 4688 | 4688 | $value = $this->coerceValue($strValue); |
| 4689 | 4689 | } |
| 4690 | 4690 | |
@@ -4763,7 +4763,7 @@ discard block |
||
| 4763 | 4763 | */ |
| 4764 | 4764 | public function addImportPath($path) |
| 4765 | 4765 | { |
| 4766 | - if (! \in_array($path, $this->importPaths)) { |
|
| 4766 | + if (!\in_array($path, $this->importPaths)) { |
|
| 4767 | 4767 | $this->importPaths[] = $path; |
| 4768 | 4768 | } |
| 4769 | 4769 | } |
@@ -4929,17 +4929,17 @@ discard block |
||
| 4929 | 4929 | $hasExtension = preg_match('/[.]s?css$/', $url); |
| 4930 | 4930 | |
| 4931 | 4931 | // for "normal" scss imports (ignore vanilla css and external requests) |
| 4932 | - if (! preg_match('~\.css$|^https?://|^//~', $url)) { |
|
| 4932 | + if (!preg_match('~\.css$|^https?://|^//~', $url)) { |
|
| 4933 | 4933 | $isPartial = (strpos(basename($url), '_') === 0); |
| 4934 | 4934 | |
| 4935 | 4935 | // try both normal and the _partial filename |
| 4936 | 4936 | $urls = [$url . ($hasExtension ? '' : '.scss')]; |
| 4937 | 4937 | |
| 4938 | - if (! $isPartial) { |
|
| 4938 | + if (!$isPartial) { |
|
| 4939 | 4939 | $urls[] = preg_replace('~[^/]+$~', '_\0', $url) . ($hasExtension ? '' : '.scss'); |
| 4940 | 4940 | } |
| 4941 | 4941 | |
| 4942 | - if (! $hasExtension) { |
|
| 4942 | + if (!$hasExtension) { |
|
| 4943 | 4943 | $urls[] = "$url/index.scss"; |
| 4944 | 4944 | $urls[] = "$url/_index.scss"; |
| 4945 | 4945 | // allow to find a plain css file, *if* no scss or partial scss is found |
@@ -4952,7 +4952,7 @@ discard block |
||
| 4952 | 4952 | // check urls for normal import paths |
| 4953 | 4953 | foreach ($urls as $full) { |
| 4954 | 4954 | $separator = ( |
| 4955 | - ! empty($dir) && |
|
| 4955 | + !empty($dir) && |
|
| 4956 | 4956 | substr($dir, -1) !== '/' && |
| 4957 | 4957 | substr($full, 0, 1) !== '/' |
| 4958 | 4958 | ) ? '/' : ''; |
@@ -4966,14 +4966,14 @@ discard block |
||
| 4966 | 4966 | // check custom callback for import path |
| 4967 | 4967 | $file = \call_user_func($dir, $url); |
| 4968 | 4968 | |
| 4969 | - if (! \is_null($file)) { |
|
| 4969 | + if (!\is_null($file)) { |
|
| 4970 | 4970 | return $file; |
| 4971 | 4971 | } |
| 4972 | 4972 | } |
| 4973 | 4973 | } |
| 4974 | 4974 | |
| 4975 | 4975 | if ($urls) { |
| 4976 | - if (! $hasExtension || preg_match('/[.]scss$/', $url)) { |
|
| 4976 | + if (!$hasExtension || preg_match('/[.]scss$/', $url)) { |
|
| 4977 | 4977 | throw $this->error("`$url` file not found for @import"); |
| 4978 | 4978 | } |
| 4979 | 4979 | } |
@@ -5061,7 +5061,7 @@ discard block |
||
| 5061 | 5061 | $msg = sprintf($msg, ...$args); |
| 5062 | 5062 | } |
| 5063 | 5063 | |
| 5064 | - if (! $this->ignoreCallStackMessage) { |
|
| 5064 | + if (!$this->ignoreCallStackMessage) { |
|
| 5065 | 5065 | $line = $this->sourceLine; |
| 5066 | 5066 | $column = $this->sourceColumn; |
| 5067 | 5067 | |
@@ -5138,7 +5138,7 @@ discard block |
||
| 5138 | 5138 | |
| 5139 | 5139 | $callStackMsg[] = $msg; |
| 5140 | 5140 | |
| 5141 | - if (! \is_null($limit) && $ncall > $limit) { |
|
| 5141 | + if (!\is_null($limit) && $ncall > $limit) { |
|
| 5142 | 5142 | break; |
| 5143 | 5143 | } |
| 5144 | 5144 | } |
@@ -5158,7 +5158,7 @@ discard block |
||
| 5158 | 5158 | protected function handleImportLoop($name) |
| 5159 | 5159 | { |
| 5160 | 5160 | for ($env = $this->env; $env; $env = $env->parent) { |
| 5161 | - if (! $env->block) { |
|
| 5161 | + if (!$env->block) { |
|
| 5162 | 5162 | continue; |
| 5163 | 5163 | } |
| 5164 | 5164 | |
@@ -5180,7 +5180,7 @@ discard block |
||
| 5180 | 5180 | */ |
| 5181 | 5181 | protected function callScssFunction($func, $argValues) |
| 5182 | 5182 | { |
| 5183 | - if (! $func) { |
|
| 5183 | + if (!$func) { |
|
| 5184 | 5184 | return static::$defaultValue; |
| 5185 | 5185 | } |
| 5186 | 5186 | $name = $func->name; |
@@ -5199,7 +5199,7 @@ discard block |
||
| 5199 | 5199 | |
| 5200 | 5200 | $this->env->marker = 'function'; |
| 5201 | 5201 | |
| 5202 | - if (! empty($func->parentEnv)) { |
|
| 5202 | + if (!empty($func->parentEnv)) { |
|
| 5203 | 5203 | $this->env->declarationScopeParent = $func->parentEnv; |
| 5204 | 5204 | } else { |
| 5205 | 5205 | throw $this->error("@function $name() without parentEnv"); |
@@ -5209,7 +5209,7 @@ discard block |
||
| 5209 | 5209 | |
| 5210 | 5210 | $this->popEnv(); |
| 5211 | 5211 | |
| 5212 | - return ! isset($ret) ? static::$defaultValue : $ret; |
|
| 5212 | + return !isset($ret) ? static::$defaultValue : $ret; |
|
| 5213 | 5213 | } |
| 5214 | 5214 | |
| 5215 | 5215 | /** |
@@ -5246,7 +5246,7 @@ discard block |
||
| 5246 | 5246 | |
| 5247 | 5247 | $returnValue = \call_user_func($function, $sorted, $kwargs); |
| 5248 | 5248 | |
| 5249 | - if (! isset($returnValue)) { |
|
| 5249 | + if (!isset($returnValue)) { |
|
| 5250 | 5250 | return null; |
| 5251 | 5251 | } |
| 5252 | 5252 | |
@@ -5264,7 +5264,7 @@ discard block |
||
| 5264 | 5264 | { |
| 5265 | 5265 | $libName = 'lib' . preg_replace_callback( |
| 5266 | 5266 | '/_(.)/', |
| 5267 | - function ($m) { |
|
| 5267 | + function($m) { |
|
| 5268 | 5268 | return ucfirst($m[1]); |
| 5269 | 5269 | }, |
| 5270 | 5270 | ucfirst($name) |
@@ -5286,7 +5286,7 @@ discard block |
||
| 5286 | 5286 | { |
| 5287 | 5287 | static $parser = null; |
| 5288 | 5288 | |
| 5289 | - if (! isset($prototypes)) { |
|
| 5289 | + if (!isset($prototypes)) { |
|
| 5290 | 5290 | $keyArgs = []; |
| 5291 | 5291 | $posArgs = []; |
| 5292 | 5292 | |
@@ -5327,7 +5327,7 @@ discard block |
||
| 5327 | 5327 | |
| 5328 | 5328 | $finalArgs = []; |
| 5329 | 5329 | |
| 5330 | - if (! \is_array(reset($prototypes))) { |
|
| 5330 | + if (!\is_array(reset($prototypes))) { |
|
| 5331 | 5331 | $prototypes = [$prototypes]; |
| 5332 | 5332 | } |
| 5333 | 5333 | |
@@ -5388,7 +5388,7 @@ discard block |
||
| 5388 | 5388 | foreach ($prototype as $i => $p) { |
| 5389 | 5389 | $name = explode(':', $p)[0]; |
| 5390 | 5390 | |
| 5391 | - if (! isset($finalArgs[$i])) { |
|
| 5391 | + if (!isset($finalArgs[$i])) { |
|
| 5392 | 5392 | $finalArgs[$i] = null; |
| 5393 | 5393 | } |
| 5394 | 5394 | } |
@@ -5421,7 +5421,7 @@ discard block |
||
| 5421 | 5421 | $this->ignoreCallStackMessage = $ignoreCallStackMessage; |
| 5422 | 5422 | } |
| 5423 | 5423 | |
| 5424 | - if ($exceptionMessage && ! $prototypeHasMatch) { |
|
| 5424 | + if ($exceptionMessage && !$prototypeHasMatch) { |
|
| 5425 | 5425 | if (\in_array($functionName, ['libRgb', 'libRgba', 'libHsl', 'libHsla'])) { |
| 5426 | 5426 | // if var() or calc() is used as an argument, return as a css function |
| 5427 | 5427 | foreach ($args as $arg) { |
@@ -5484,12 +5484,12 @@ discard block |
||
| 5484 | 5484 | |
| 5485 | 5485 | // assign the keyword args |
| 5486 | 5486 | foreach ((array) $argValues as $arg) { |
| 5487 | - if (! empty($arg[0])) { |
|
| 5487 | + if (!empty($arg[0])) { |
|
| 5488 | 5488 | $hasKeywordArgument = true; |
| 5489 | 5489 | |
| 5490 | 5490 | $name = $arg[0][1]; |
| 5491 | 5491 | |
| 5492 | - if (! isset($args[$name])) { |
|
| 5492 | + if (!isset($args[$name])) { |
|
| 5493 | 5493 | foreach (array_keys($args) as $an) { |
| 5494 | 5494 | if (str_replace('_', '-', $an) === str_replace('_', '-', $name)) { |
| 5495 | 5495 | $name = $an; |
@@ -5498,7 +5498,7 @@ discard block |
||
| 5498 | 5498 | } |
| 5499 | 5499 | } |
| 5500 | 5500 | |
| 5501 | - if (! isset($args[$name]) || $args[$name][3]) { |
|
| 5501 | + if (!isset($args[$name]) || $args[$name][3]) { |
|
| 5502 | 5502 | if ($hasVariable) { |
| 5503 | 5503 | $deferredNamedKeywordArgs[$name] = $arg[1]; |
| 5504 | 5504 | } else { |
@@ -5509,14 +5509,14 @@ discard block |
||
| 5509 | 5509 | } else { |
| 5510 | 5510 | $keywordArgs[$name] = $arg[1]; |
| 5511 | 5511 | } |
| 5512 | - } elseif (! empty($arg[2])) { |
|
| 5512 | + } elseif (!empty($arg[2])) { |
|
| 5513 | 5513 | // $arg[2] means a var followed by ... in the arg ($list... ) |
| 5514 | 5514 | $val = $this->reduce($arg[1], true); |
| 5515 | 5515 | |
| 5516 | 5516 | if ($val[0] === Type::T_LIST) { |
| 5517 | 5517 | foreach ($val[2] as $name => $item) { |
| 5518 | - if (! is_numeric($name)) { |
|
| 5519 | - if (! isset($args[$name])) { |
|
| 5518 | + if (!is_numeric($name)) { |
|
| 5519 | + if (!isset($args[$name])) { |
|
| 5520 | 5520 | foreach (array_keys($args) as $an) { |
| 5521 | 5521 | if (str_replace('_', '-', $an) === str_replace('_', '-', $name)) { |
| 5522 | 5522 | $name = $an; |
@@ -5543,8 +5543,8 @@ discard block |
||
| 5543 | 5543 | $name = $this->compileStringContent($this->coerceString($name)); |
| 5544 | 5544 | $item = $val[2][$i]; |
| 5545 | 5545 | |
| 5546 | - if (! is_numeric($name)) { |
|
| 5547 | - if (! isset($args[$name])) { |
|
| 5546 | + if (!is_numeric($name)) { |
|
| 5547 | + if (!isset($args[$name])) { |
|
| 5548 | 5548 | foreach (array_keys($args) as $an) { |
| 5549 | 5549 | if (str_replace('_', '-', $an) === str_replace('_', '-', $name)) { |
| 5550 | 5550 | $name = $an; |
@@ -5588,7 +5588,7 @@ discard block |
||
| 5588 | 5588 | } |
| 5589 | 5589 | } |
| 5590 | 5590 | |
| 5591 | - $val = [Type::T_LIST, \is_null($splatSeparator) ? ',' : $splatSeparator , [], $isVariable]; |
|
| 5591 | + $val = [Type::T_LIST, \is_null($splatSeparator) ? ',' : $splatSeparator, [], $isVariable]; |
|
| 5592 | 5592 | |
| 5593 | 5593 | for ($count = \count($remaining); $i < $count; $i++) { |
| 5594 | 5594 | $val[2][] = $remaining[$i]; |
@@ -5605,7 +5605,7 @@ discard block |
||
| 5605 | 5605 | $val = $remaining[$i]; |
| 5606 | 5606 | } elseif (isset($keywordArgs[$name])) { |
| 5607 | 5607 | $val = $keywordArgs[$name]; |
| 5608 | - } elseif (! empty($default)) { |
|
| 5608 | + } elseif (!empty($default)) { |
|
| 5609 | 5609 | continue; |
| 5610 | 5610 | } else { |
| 5611 | 5611 | throw $this->error("Missing argument $name"); |
@@ -5753,7 +5753,7 @@ discard block |
||
| 5753 | 5753 | return [Type::T_LIST, ',', $list]; |
| 5754 | 5754 | } |
| 5755 | 5755 | |
| 5756 | - return [Type::T_LIST, $delim, ! isset($item) ? [] : [$item]]; |
|
| 5756 | + return [Type::T_LIST, $delim, !isset($item) ? [] : [$item]]; |
|
| 5757 | 5757 | } |
| 5758 | 5758 | |
| 5759 | 5759 | /** |
@@ -5784,10 +5784,10 @@ discard block |
||
| 5784 | 5784 | switch ($value[0]) { |
| 5785 | 5785 | case Type::T_COLOR: |
| 5786 | 5786 | for ($i = 1; $i <= 3; $i++) { |
| 5787 | - if (! is_numeric($value[$i])) { |
|
| 5787 | + if (!is_numeric($value[$i])) { |
|
| 5788 | 5788 | $cv = $this->compileRGBAValue($value[$i]); |
| 5789 | 5789 | |
| 5790 | - if (! is_numeric($cv)) { |
|
| 5790 | + if (!is_numeric($cv)) { |
|
| 5791 | 5791 | return null; |
| 5792 | 5792 | } |
| 5793 | 5793 | |
@@ -5795,10 +5795,10 @@ discard block |
||
| 5795 | 5795 | } |
| 5796 | 5796 | |
| 5797 | 5797 | if (isset($value[4])) { |
| 5798 | - if (! is_numeric($value[4])) { |
|
| 5798 | + if (!is_numeric($value[4])) { |
|
| 5799 | 5799 | $cv = $this->compileRGBAValue($value[4], true); |
| 5800 | 5800 | |
| 5801 | - if (! is_numeric($cv)) { |
|
| 5801 | + if (!is_numeric($cv)) { |
|
| 5802 | 5802 | return null; |
| 5803 | 5803 | } |
| 5804 | 5804 | |
@@ -5822,7 +5822,7 @@ discard block |
||
| 5822 | 5822 | return null; |
| 5823 | 5823 | |
| 5824 | 5824 | case Type::T_KEYWORD: |
| 5825 | - if (! \is_string($value[1])) { |
|
| 5825 | + if (!\is_string($value[1])) { |
|
| 5826 | 5826 | return null; |
| 5827 | 5827 | } |
| 5828 | 5828 | |
@@ -5915,7 +5915,7 @@ discard block |
||
| 5915 | 5915 | */ |
| 5916 | 5916 | protected function compileColorPartValue($value, $min, $max, $isInt = true, $clamp = true, $modulo = false) |
| 5917 | 5917 | { |
| 5918 | - if (! is_numeric($value)) { |
|
| 5918 | + if (!is_numeric($value)) { |
|
| 5919 | 5919 | if (\is_array($value)) { |
| 5920 | 5920 | $reduced = $this->reduce($value); |
| 5921 | 5921 | |
@@ -5996,7 +5996,7 @@ discard block |
||
| 5996 | 5996 | protected function coercePercent($value) |
| 5997 | 5997 | { |
| 5998 | 5998 | if ($value[0] === Type::T_NUMBER) { |
| 5999 | - if (! empty($value[2]['%'])) { |
|
| 5999 | + if (!empty($value[2]['%'])) { |
|
| 6000 | 6000 | return $value[1] / 100; |
| 6001 | 6001 | } |
| 6002 | 6002 | |
@@ -6234,7 +6234,7 @@ discard block |
||
| 6234 | 6234 | return static::$null; |
| 6235 | 6235 | } |
| 6236 | 6236 | |
| 6237 | - if (! in_array($functionReference[0], [Type::T_FUNCTION_REFERENCE, Type::T_FUNCTION])) { |
|
| 6237 | + if (!in_array($functionReference[0], [Type::T_FUNCTION_REFERENCE, Type::T_FUNCTION])) { |
|
| 6238 | 6238 | throw $this->error('Function reference expected, got ' . $functionReference[0]); |
| 6239 | 6239 | } |
| 6240 | 6240 | |
@@ -6245,7 +6245,7 @@ discard block |
||
| 6245 | 6245 | if (is_numeric($varname)) { |
| 6246 | 6246 | $varname = null; |
| 6247 | 6247 | } else { |
| 6248 | - $varname = [ 'var', $varname]; |
|
| 6248 | + $varname = ['var', $varname]; |
|
| 6249 | 6249 | } |
| 6250 | 6250 | |
| 6251 | 6251 | $callArgs[] = [$varname, $arg, false]; |
@@ -6281,7 +6281,7 @@ discard block |
||
| 6281 | 6281 | { |
| 6282 | 6282 | list($cond, $t, $f) = $args; |
| 6283 | 6283 | |
| 6284 | - if (! $this->isTruthy($this->reduce($cond, true))) { |
|
| 6284 | + if (!$this->isTruthy($this->reduce($cond, true))) { |
|
| 6285 | 6285 | return $this->reduce($f, true); |
| 6286 | 6286 | } |
| 6287 | 6287 | |
@@ -6322,12 +6322,12 @@ discard block |
||
| 6322 | 6322 | ['color', 'alpha'], |
| 6323 | 6323 | ['channels'], |
| 6324 | 6324 | ['red', 'green', 'blue'], |
| 6325 | - ['red', 'green', 'blue', 'alpha'] ]; |
|
| 6325 | + ['red', 'green', 'blue', 'alpha']]; |
|
| 6326 | 6326 | protected function libRgb($args, $kwargs, $funcName = 'rgb') |
| 6327 | 6327 | { |
| 6328 | 6328 | switch (\count($args)) { |
| 6329 | 6329 | case 1: |
| 6330 | - if (! $color = $this->coerceColor($args[0], true)) { |
|
| 6330 | + if (!$color = $this->coerceColor($args[0], true)) { |
|
| 6331 | 6331 | $color = [Type::T_STRING, '', [$funcName . '(', $args[0], ')']]; |
| 6332 | 6332 | } |
| 6333 | 6333 | break; |
@@ -6335,7 +6335,7 @@ discard block |
||
| 6335 | 6335 | case 3: |
| 6336 | 6336 | $color = [Type::T_COLOR, $args[0], $args[1], $args[2]]; |
| 6337 | 6337 | |
| 6338 | - if (! $color = $this->coerceColor($color)) { |
|
| 6338 | + if (!$color = $this->coerceColor($color)) { |
|
| 6339 | 6339 | $color = [Type::T_STRING, '', [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ')']]; |
| 6340 | 6340 | } |
| 6341 | 6341 | |
@@ -6360,7 +6360,7 @@ discard block |
||
| 6360 | 6360 | default: |
| 6361 | 6361 | $color = [Type::T_COLOR, $args[0], $args[1], $args[2], $args[3]]; |
| 6362 | 6362 | |
| 6363 | - if (! $color = $this->coerceColor($color)) { |
|
| 6363 | + if (!$color = $this->coerceColor($color)) { |
|
| 6364 | 6364 | $color = [Type::T_STRING, '', |
| 6365 | 6365 | [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ', ', $args[3], ')']]; |
| 6366 | 6366 | } |
@@ -6375,7 +6375,7 @@ discard block |
||
| 6375 | 6375 | ['color', 'alpha'], |
| 6376 | 6376 | ['channels'], |
| 6377 | 6377 | ['red', 'green', 'blue'], |
| 6378 | - ['red', 'green', 'blue', 'alpha'] ]; |
|
| 6378 | + ['red', 'green', 'blue', 'alpha']]; |
|
| 6379 | 6379 | protected function libRgba($args, $kwargs) |
| 6380 | 6380 | { |
| 6381 | 6381 | return $this->libRgb($args, $kwargs, 'rgba'); |
@@ -6390,7 +6390,7 @@ discard block |
||
| 6390 | 6390 | if (isset($args[$iarg])) { |
| 6391 | 6391 | $val = $this->assertNumber($args[$iarg]); |
| 6392 | 6392 | |
| 6393 | - if (! isset($color[$irgba])) { |
|
| 6393 | + if (!isset($color[$irgba])) { |
|
| 6394 | 6394 | $color[$irgba] = (($irgba < 4) ? 0 : 1); |
| 6395 | 6395 | } |
| 6396 | 6396 | |
@@ -6398,11 +6398,11 @@ discard block |
||
| 6398 | 6398 | } |
| 6399 | 6399 | } |
| 6400 | 6400 | |
| 6401 | - if (! empty($args[4]) || ! empty($args[5]) || ! empty($args[6])) { |
|
| 6401 | + if (!empty($args[4]) || !empty($args[5]) || !empty($args[6])) { |
|
| 6402 | 6402 | $hsl = $this->toHSL($color[1], $color[2], $color[3]); |
| 6403 | 6403 | |
| 6404 | 6404 | foreach ([4 => 1, 5 => 2, 6 => 3] as $iarg => $ihsl) { |
| 6405 | - if (! empty($args[$iarg])) { |
|
| 6405 | + if (!empty($args[$iarg])) { |
|
| 6406 | 6406 | $val = $this->assertNumber($args[$iarg]); |
| 6407 | 6407 | $hsl[$ihsl] = \call_user_func($fn, $hsl[$ihsl], $val, $iarg); |
| 6408 | 6408 | } |
@@ -6426,7 +6426,7 @@ discard block |
||
| 6426 | 6426 | ]; |
| 6427 | 6427 | protected function libAdjustColor($args) |
| 6428 | 6428 | { |
| 6429 | - return $this->alterColor($args, function ($base, $alter, $i) { |
|
| 6429 | + return $this->alterColor($args, function($base, $alter, $i) { |
|
| 6430 | 6430 | return $base + $alter; |
| 6431 | 6431 | }); |
| 6432 | 6432 | } |
@@ -6437,7 +6437,7 @@ discard block |
||
| 6437 | 6437 | ]; |
| 6438 | 6438 | protected function libChangeColor($args) |
| 6439 | 6439 | { |
| 6440 | - return $this->alterColor($args, function ($base, $alter, $i) { |
|
| 6440 | + return $this->alterColor($args, function($base, $alter, $i) { |
|
| 6441 | 6441 | return $alter; |
| 6442 | 6442 | }); |
| 6443 | 6443 | } |
@@ -6448,7 +6448,7 @@ discard block |
||
| 6448 | 6448 | ]; |
| 6449 | 6449 | protected function libScaleColor($args) |
| 6450 | 6450 | { |
| 6451 | - return $this->alterColor($args, function ($base, $scale, $i) { |
|
| 6451 | + return $this->alterColor($args, function($base, $scale, $i) { |
|
| 6452 | 6452 | // 1, 2, 3 - rgb |
| 6453 | 6453 | // 4, 5, 6 - hsl |
| 6454 | 6454 | // 7 - a |
@@ -6566,7 +6566,7 @@ discard block |
||
| 6566 | 6566 | $first = $this->assertColor($first); |
| 6567 | 6567 | $second = $this->assertColor($second); |
| 6568 | 6568 | |
| 6569 | - if (! isset($weight)) { |
|
| 6569 | + if (!isset($weight)) { |
|
| 6570 | 6570 | $weight = 0.5; |
| 6571 | 6571 | } else { |
| 6572 | 6572 | $weight = $this->coercePercent($weight); |
@@ -6597,7 +6597,7 @@ discard block |
||
| 6597 | 6597 | protected static $libHsl = [ |
| 6598 | 6598 | ['channels'], |
| 6599 | 6599 | ['hue', 'saturation', 'lightness'], |
| 6600 | - ['hue', 'saturation', 'lightness', 'alpha'] ]; |
|
| 6600 | + ['hue', 'saturation', 'lightness', 'alpha']]; |
|
| 6601 | 6601 | protected function libHsl($args, $kwargs, $funcName = 'hsl') |
| 6602 | 6602 | { |
| 6603 | 6603 | $args_to_check = $args; |
@@ -6634,7 +6634,7 @@ discard block |
||
| 6634 | 6634 | if ( |
| 6635 | 6635 | $k >= 2 && count($args) === 4 && |
| 6636 | 6636 | in_array($arg[0], [Type::T_FUNCTION_CALL, Type::T_FUNCTION]) && |
| 6637 | - in_array($arg[1], ['calc','env']) |
|
| 6637 | + in_array($arg[1], ['calc', 'env']) |
|
| 6638 | 6638 | ) { |
| 6639 | 6639 | return null; |
| 6640 | 6640 | } |
@@ -6645,19 +6645,19 @@ discard block |
||
| 6645 | 6645 | if (\count($args) === 4) { |
| 6646 | 6646 | $alpha = $this->compileColorPartValue($args[3], 0, 100, false); |
| 6647 | 6647 | |
| 6648 | - if (! is_numeric($hue) || ! is_numeric($saturation) || ! is_numeric($lightness) || ! is_numeric($alpha)) { |
|
| 6648 | + if (!is_numeric($hue) || !is_numeric($saturation) || !is_numeric($lightness) || !is_numeric($alpha)) { |
|
| 6649 | 6649 | return [Type::T_STRING, '', |
| 6650 | 6650 | [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ', ', $args[3], ')']]; |
| 6651 | 6651 | } |
| 6652 | 6652 | } else { |
| 6653 | - if (! is_numeric($hue) || ! is_numeric($saturation) || ! is_numeric($lightness)) { |
|
| 6653 | + if (!is_numeric($hue) || !is_numeric($saturation) || !is_numeric($lightness)) { |
|
| 6654 | 6654 | return [Type::T_STRING, '', [$funcName . '(', $args[0], ', ', $args[1], ', ', $args[2], ')']]; |
| 6655 | 6655 | } |
| 6656 | 6656 | } |
| 6657 | 6657 | |
| 6658 | 6658 | $color = $this->toRGB($hue, $saturation, $lightness); |
| 6659 | 6659 | |
| 6660 | - if (! \is_null($alpha)) { |
|
| 6660 | + if (!\is_null($alpha)) { |
|
| 6661 | 6661 | $color[4] = $alpha; |
| 6662 | 6662 | } |
| 6663 | 6663 | |
@@ -6792,7 +6792,7 @@ discard block |
||
| 6792 | 6792 | { |
| 6793 | 6793 | list($value, $weight) = $args; |
| 6794 | 6794 | |
| 6795 | - if (! isset($weight)) { |
|
| 6795 | + if (!isset($weight)) { |
|
| 6796 | 6796 | $weight = 1; |
| 6797 | 6797 | } else { |
| 6798 | 6798 | $weight = $this->coercePercent($weight); |
@@ -6870,7 +6870,7 @@ discard block |
||
| 6870 | 6870 | { |
| 6871 | 6871 | $value = $args[0]; |
| 6872 | 6872 | |
| 6873 | - if ($value[0] === Type::T_STRING && ! empty($value[1])) { |
|
| 6873 | + if ($value[0] === Type::T_STRING && !empty($value[1])) { |
|
| 6874 | 6874 | return $value; |
| 6875 | 6875 | } |
| 6876 | 6876 | |
@@ -6984,7 +6984,7 @@ discard block |
||
| 6984 | 6984 | if (empty($unit)) { |
| 6985 | 6985 | $unit = $number[2]; |
| 6986 | 6986 | $originalUnit = $item->unitStr(); |
| 6987 | - } elseif ($number[1] && $unit !== $number[2] && ! empty($number[2])) { |
|
| 6987 | + } elseif ($number[1] && $unit !== $number[2] && !empty($number[2])) { |
|
| 6988 | 6988 | throw $this->error('Incompatible units: "%s" and "%s".', $originalUnit, $item->unitStr()); |
| 6989 | 6989 | } |
| 6990 | 6990 | |
@@ -7049,7 +7049,7 @@ discard block |
||
| 7049 | 7049 | $n += \count($list[2]); |
| 7050 | 7050 | } |
| 7051 | 7051 | |
| 7052 | - if (! isset($list[2][$n])) { |
|
| 7052 | + if (!isset($list[2][$n])) { |
|
| 7053 | 7053 | throw $this->error('Invalid argument for "n"'); |
| 7054 | 7054 | } |
| 7055 | 7055 | |
@@ -7064,7 +7064,7 @@ discard block |
||
| 7064 | 7064 | $map = $this->assertMap($args[0]); |
| 7065 | 7065 | $key = $args[1]; |
| 7066 | 7066 | |
| 7067 | - if (! \is_null($key)) { |
|
| 7067 | + if (!\is_null($key)) { |
|
| 7068 | 7068 | $key = $this->compileStringContent($this->coerceString($key)); |
| 7069 | 7069 | |
| 7070 | 7070 | for ($i = \count($map[1]) - 1; $i >= 0; $i--) { |
@@ -7180,7 +7180,7 @@ discard block |
||
| 7180 | 7180 | $list = $args[0]; |
| 7181 | 7181 | $this->coerceList($list, ' '); |
| 7182 | 7182 | |
| 7183 | - if (! empty($list['enclosing']) && $list['enclosing'] === 'bracket') { |
|
| 7183 | + if (!empty($list['enclosing']) && $list['enclosing'] === 'bracket') { |
|
| 7184 | 7184 | return true; |
| 7185 | 7185 | } |
| 7186 | 7186 | |
@@ -7189,7 +7189,7 @@ discard block |
||
| 7189 | 7189 | |
| 7190 | 7190 | protected function listSeparatorForJoin($list1, $sep) |
| 7191 | 7191 | { |
| 7192 | - if (! isset($sep)) { |
|
| 7192 | + if (!isset($sep)) { |
|
| 7193 | 7193 | return $list1[1]; |
| 7194 | 7194 | } |
| 7195 | 7195 | |
@@ -7224,7 +7224,7 @@ discard block |
||
| 7224 | 7224 | $bracketed = false; |
| 7225 | 7225 | } else { |
| 7226 | 7226 | $bracketed = $this->compileValue($bracketed); |
| 7227 | - $bracketed = ! ! $bracketed; |
|
| 7227 | + $bracketed = !!$bracketed; |
|
| 7228 | 7228 | |
| 7229 | 7229 | if ($bracketed === true) { |
| 7230 | 7230 | $bracketed = true; |
@@ -7234,7 +7234,7 @@ discard block |
||
| 7234 | 7234 | if ($bracketed === 'auto') { |
| 7235 | 7235 | $bracketed = false; |
| 7236 | 7236 | |
| 7237 | - if (! empty($list1['enclosing']) && $list1['enclosing'] === 'bracket') { |
|
| 7237 | + if (!empty($list1['enclosing']) && $list1['enclosing'] === 'bracket') { |
|
| 7238 | 7238 | $bracketed = true; |
| 7239 | 7239 | } |
| 7240 | 7240 | } |
@@ -7356,8 +7356,8 @@ discard block |
||
| 7356 | 7356 | list($number1, $number2) = $args; |
| 7357 | 7357 | |
| 7358 | 7358 | if ( |
| 7359 | - ! isset($number1[0]) || $number1[0] !== Type::T_NUMBER || |
|
| 7360 | - ! isset($number2[0]) || $number2[0] !== Type::T_NUMBER |
|
| 7359 | + !isset($number1[0]) || $number1[0] !== Type::T_NUMBER || |
|
| 7360 | + !isset($number2[0]) || $number2[0] !== Type::T_NUMBER |
|
| 7361 | 7361 | ) { |
| 7362 | 7362 | throw $this->error('Invalid argument(s) for "comparable"'); |
| 7363 | 7363 | } |
@@ -7410,7 +7410,7 @@ discard block |
||
| 7410 | 7410 | protected static $libStrSlice = ['string', 'start-at', 'end-at:-1']; |
| 7411 | 7411 | protected function libStrSlice($args) |
| 7412 | 7412 | { |
| 7413 | - if (isset($args[2]) && ! $args[2][1]) { |
|
| 7413 | + if (isset($args[2]) && !$args[2][1]) { |
|
| 7414 | 7414 | return static::$nullString; |
| 7415 | 7415 | } |
| 7416 | 7416 | |
@@ -7554,7 +7554,7 @@ discard block |
||
| 7554 | 7554 | { |
| 7555 | 7555 | static $id; |
| 7556 | 7556 | |
| 7557 | - if (! isset($id)) { |
|
| 7557 | + if (!isset($id)) { |
|
| 7558 | 7558 | $id = PHP_INT_SIZE === 4 |
| 7559 | 7559 | ? mt_rand(0, pow(36, 5)) . str_pad(mt_rand(0, pow(36, 5)) % 10000000, 7, '0', STR_PAD_LEFT) |
| 7560 | 7560 | : mt_rand(0, pow(36, 8)); |
@@ -7581,10 +7581,10 @@ discard block |
||
| 7581 | 7581 | } |
| 7582 | 7582 | |
| 7583 | 7583 | if ( |
| 7584 | - ! empty($value['enclosing']) && |
|
| 7584 | + !empty($value['enclosing']) && |
|
| 7585 | 7585 | ($force_enclosing_display || |
| 7586 | 7586 | ($value['enclosing'] === 'bracket') || |
| 7587 | - ! \count($value[2])) |
|
| 7587 | + !\count($value[2])) |
|
| 7588 | 7588 | ) { |
| 7589 | 7589 | $value['enclosing'] = 'forced_' . $value['enclosing']; |
| 7590 | 7590 | $force_enclosing_display = true; |
@@ -7674,11 +7674,11 @@ discard block |
||
| 7674 | 7674 | protected function isSuperSelector($super, $sub) |
| 7675 | 7675 | { |
| 7676 | 7676 | // one and only one selector for each arg |
| 7677 | - if (! $super || \count($super) !== 1) { |
|
| 7677 | + if (!$super || \count($super) !== 1) { |
|
| 7678 | 7678 | throw $this->error('Invalid super selector for isSuperSelector()'); |
| 7679 | 7679 | } |
| 7680 | 7680 | |
| 7681 | - if (! $sub || \count($sub) !== 1) { |
|
| 7681 | + if (!$sub || \count($sub) !== 1) { |
|
| 7682 | 7682 | throw $this->error('Invalid sub selector for isSuperSelector()'); |
| 7683 | 7683 | } |
| 7684 | 7684 | |
@@ -7693,7 +7693,7 @@ discard block |
||
| 7693 | 7693 | |
| 7694 | 7694 | array_walk_recursive( |
| 7695 | 7695 | $node, |
| 7696 | - function ($value, $key) use (&$compound) { |
|
| 7696 | + function($value, $key) use (&$compound) { |
|
| 7697 | 7697 | $compound .= $value; |
| 7698 | 7698 | } |
| 7699 | 7699 | ); |
@@ -7706,7 +7706,7 @@ discard block |
||
| 7706 | 7706 | $nextMustMatch = true; |
| 7707 | 7707 | $i++; |
| 7708 | 7708 | } else { |
| 7709 | - while ($i < \count($sub) && ! $this->isSuperPart($node, $sub[$i])) { |
|
| 7709 | + while ($i < \count($sub) && !$this->isSuperPart($node, $sub[$i])) { |
|
| 7710 | 7710 | if ($nextMustMatch) { |
| 7711 | 7711 | return false; |
| 7712 | 7712 | } |
@@ -7782,14 +7782,14 @@ discard block |
||
| 7782 | 7782 | { |
| 7783 | 7783 | $lastSelectors = array_pop($selectors); |
| 7784 | 7784 | |
| 7785 | - if (! $lastSelectors) { |
|
| 7785 | + if (!$lastSelectors) { |
|
| 7786 | 7786 | throw $this->error('Invalid selector list in selector-append()'); |
| 7787 | 7787 | } |
| 7788 | 7788 | |
| 7789 | 7789 | while (\count($selectors)) { |
| 7790 | 7790 | $previousSelectors = array_pop($selectors); |
| 7791 | 7791 | |
| 7792 | - if (! $previousSelectors) { |
|
| 7792 | + if (!$previousSelectors) { |
|
| 7793 | 7793 | throw $this->error('Invalid selector list in selector-append()'); |
| 7794 | 7794 | } |
| 7795 | 7795 | |
@@ -7832,7 +7832,7 @@ discard block |
||
| 7832 | 7832 | $extendee = $this->getSelectorArg($extendee); |
| 7833 | 7833 | $extender = $this->getSelectorArg($extender); |
| 7834 | 7834 | |
| 7835 | - if (! $selectors || ! $extendee || ! $extender) { |
|
| 7835 | + if (!$selectors || !$extendee || !$extender) { |
|
| 7836 | 7836 | throw $this->error('selector-extend() invalid arguments'); |
| 7837 | 7837 | } |
| 7838 | 7838 | |
@@ -7853,7 +7853,7 @@ discard block |
||
| 7853 | 7853 | $original = $this->getSelectorArg($original); |
| 7854 | 7854 | $replacement = $this->getSelectorArg($replacement); |
| 7855 | 7855 | |
| 7856 | - if (! $selectors || ! $original || ! $replacement) { |
|
| 7856 | + if (!$selectors || !$original || !$replacement) { |
|
| 7857 | 7857 | throw $this->error('selector-replace() invalid arguments'); |
| 7858 | 7858 | } |
| 7859 | 7859 | |
@@ -7889,7 +7889,7 @@ discard block |
||
| 7889 | 7889 | $extended = []; |
| 7890 | 7890 | |
| 7891 | 7891 | foreach ($selectors as $selector) { |
| 7892 | - if (! $replace) { |
|
| 7892 | + if (!$replace) { |
|
| 7893 | 7893 | $extended[] = $selector; |
| 7894 | 7894 | } |
| 7895 | 7895 | |
@@ -7957,7 +7957,7 @@ discard block |
||
| 7957 | 7957 | $selectors1 = $this->getSelectorArg($selectors1); |
| 7958 | 7958 | $selectors2 = $this->getSelectorArg($selectors2); |
| 7959 | 7959 | |
| 7960 | - if (! $selectors1 || ! $selectors2) { |
|
| 7960 | + if (!$selectors1 || !$selectors2) { |
|
| 7961 | 7961 | throw $this->error('selector-unify() invalid arguments'); |
| 7962 | 7962 | } |
| 7963 | 7963 | |
@@ -7982,11 +7982,11 @@ discard block |
||
| 7982 | 7982 | */ |
| 7983 | 7983 | protected function unifyCompoundSelectors($compound1, $compound2) |
| 7984 | 7984 | { |
| 7985 | - if (! \count($compound1)) { |
|
| 7985 | + if (!\count($compound1)) { |
|
| 7986 | 7986 | return $compound2; |
| 7987 | 7987 | } |
| 7988 | 7988 | |
| 7989 | - if (! \count($compound2)) { |
|
| 7989 | + if (!\count($compound2)) { |
|
| 7990 | 7990 | return $compound1; |
| 7991 | 7991 | } |
| 7992 | 7992 | |
@@ -7995,7 +7995,7 @@ discard block |
||
| 7995 | 7995 | $lastPart2 = array_pop($compound2); |
| 7996 | 7996 | $last = $this->mergeParts($lastPart1, $lastPart2); |
| 7997 | 7997 | |
| 7998 | - if (! $last) { |
|
| 7998 | + if (!$last) { |
|
| 7999 | 7999 | return [[]]; |
| 8000 | 8000 | } |
| 8001 | 8001 | |
@@ -8219,7 +8219,7 @@ discard block |
||
| 8219 | 8219 | protected function findTagName($parts) |
| 8220 | 8220 | { |
| 8221 | 8221 | foreach ($parts as $part) { |
| 8222 | - if (! preg_match('/^[\[.:#%_-]/', $part)) { |
|
| 8222 | + if (!preg_match('/^[\[.:#%_-]/', $part)) { |
|
| 8223 | 8223 | return $part; |
| 8224 | 8224 | } |
| 8225 | 8225 | } |
@@ -8257,7 +8257,7 @@ discard block |
||
| 8257 | 8257 | $listParts = []; |
| 8258 | 8258 | |
| 8259 | 8259 | foreach ($matches as $match) { |
| 8260 | - if (! is_file($match)) { |
|
| 8260 | + if (!is_file($match)) { |
|
| 8261 | 8261 | continue; |
| 8262 | 8262 | } |
| 8263 | 8263 | |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | { |
| 214 | 214 | static $reverseColorTable = null; |
| 215 | 215 | |
| 216 | - if (! is_numeric($r) || ! is_numeric($g) || ! is_numeric($b) || ! is_numeric($a)) { |
|
| 216 | + if (!is_numeric($r) || !is_numeric($g) || !is_numeric($b) || !is_numeric($a)) { |
|
| 217 | 217 | return null; |
| 218 | 218 | } |
| 219 | 219 | |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | |
| 230 | 230 | if ( |
| 231 | 231 | \count($rgb_str) == 3 && |
| 232 | - ! isset($reverseColorTable[\intval($rgb_str[0])][\intval($rgb_str[1])][\intval($rgb_str[2])]) |
|
| 232 | + !isset($reverseColorTable[\intval($rgb_str[0])][\intval($rgb_str[1])][\intval($rgb_str[2])]) |
|
| 233 | 233 | ) { |
| 234 | 234 | $reverseColorTable[\intval($rgb_str[0])][\intval($rgb_str[1])][\intval($rgb_str[2])] = $name; |
| 235 | 235 | } |
@@ -147,7 +147,7 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | $this->write($inner . implode($glue, $block->lines)); |
| 149 | 149 | |
| 150 | - if (! empty($block->children)) { |
|
| 150 | + if (!empty($block->children)) { |
|
| 151 | 151 | $this->write($this->break); |
| 152 | 152 | } |
| 153 | 153 | } |
@@ -193,24 +193,24 @@ discard block |
||
| 193 | 193 | |
| 194 | 194 | $pre = $this->indentStr(); |
| 195 | 195 | |
| 196 | - if (! empty($block->selectors)) { |
|
| 196 | + if (!empty($block->selectors)) { |
|
| 197 | 197 | $this->blockSelectors($block); |
| 198 | 198 | |
| 199 | 199 | $this->indentLevel++; |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | - if (! empty($block->lines)) { |
|
| 202 | + if (!empty($block->lines)) { |
|
| 203 | 203 | $this->blockLines($block); |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | - if (! empty($block->children)) { |
|
| 206 | + if (!empty($block->children)) { |
|
| 207 | 207 | $this->blockChildren($block); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | - if (! empty($block->selectors)) { |
|
| 210 | + if (!empty($block->selectors)) { |
|
| 211 | 211 | $this->indentLevel--; |
| 212 | 212 | |
| 213 | - if (! $this->keepSemicolons) { |
|
| 213 | + if (!$this->keepSemicolons) { |
|
| 214 | 214 | $this->strippedSemicolon = ''; |
| 215 | 215 | } |
| 216 | 216 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | if ($block->children) { |
| 237 | 237 | foreach ($block->children as $k => &$child) { |
| 238 | - if (! $this->testEmptyChildren($child)) { |
|
| 238 | + if (!$this->testEmptyChildren($child)) { |
|
| 239 | 239 | $isEmpty = false; |
| 240 | 240 | continue; |
| 241 | 241 | } |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | */ |
| 289 | 289 | protected function write($str) |
| 290 | 290 | { |
| 291 | - if (! empty($this->strippedSemicolon)) { |
|
| 291 | + if (!empty($this->strippedSemicolon)) { |
|
| 292 | 292 | echo $this->strippedSemicolon; |
| 293 | 293 | |
| 294 | 294 | $this->strippedSemicolon = ''; |
@@ -299,7 +299,7 @@ discard block |
||
| 299 | 299 | * will be striped for real before a closing, otherwise displayed unchanged starting the next write |
| 300 | 300 | */ |
| 301 | 301 | if ( |
| 302 | - ! $this->keepSemicolons && |
|
| 302 | + !$this->keepSemicolons && |
|
| 303 | 303 | $str && |
| 304 | 304 | (strpos($str, ';') !== false) && |
| 305 | 305 | (substr($str, -1) === ';') |