| @@ -34,7 +34,7 @@ | ||
| 34 | 34 | ], $options); | 
| 35 | 35 | |
| 36 | 36 |          if ($options['escape']) { | 
| 37 | -            $words = array_map(function ($word) { | |
| 37 | +            $words = array_map(function($word) { | |
| 38 | 38 | return preg_quote($word, '/'); | 
| 39 | 39 | }, $words); | 
| 40 | 40 | } | 
| @@ -45,14 +45,14 @@ | ||
| 45 | 45 | |
| 46 | 46 | public static function rearrange(array $array, array $keys) | 
| 47 | 47 |      { | 
| 48 | -        return array_combine($keys, array_map(function ($key) use ($array) { | |
| 48 | +        return array_combine($keys, array_map(function($key) use ($array) { | |
| 49 | 49 | return $array[$key]; | 
| 50 | 50 | }, $keys)); | 
| 51 | 51 | } | 
| 52 | 52 | |
| 53 | 53 | public static function column(array $array, $index) | 
| 54 | 54 |      { | 
| 55 | -        return array_map(function ($e) use ($index) { return $e[$index]; }, $array); | |
| 55 | +        return array_map(function($e) use ($index) { return $e[$index]; }, $array); | |
| 56 | 56 | } | 
| 57 | 57 | |
| 58 | 58 | public static function find(array $array, callable $tester) | 
| @@ -35,7 +35,7 @@ discard block | ||
| 35 | 35 | * @param $styles | 
| 36 | 36 | */ | 
| 37 | 37 |      public function __construct($styles = false) { | 
| 38 | - $this->_styles = $styles ?: include __DIR__.'/../Styles/Cli/Default.php'; | |
| 38 | + $this->_styles = $styles ?: include __DIR__ . '/../Styles/Cli/Default.php'; | |
| 39 | 39 | } | 
| 40 | 40 | |
| 41 | 41 | public function format(TokenIterator $tokens) | 
| @@ -55,7 +55,7 @@ discard block | ||
| 55 | 55 | |
| 56 | 56 | $last = $token->pos; | 
| 57 | 57 | } | 
| 58 | - $result .= substr($source, $last).Console::reset(); | |
| 58 | + $result .= substr($source, $last) . Console::reset(); | |
| 59 | 59 | |
| 60 | 60 | return $result; | 
| 61 | 61 | } | 
| @@ -40,7 +40,7 @@ | ||
| 40 | 40 | 'INTERSECT', 'INTERVAL', 'INTO', 'IS', 'ITERATE', 'LANGUAGE', 'LARGE', 'LATERAL', 'LEADING', | 
| 41 | 41 | 'LEAVE', 'LEFT', 'LIKE', 'LOCAL', 'LOOP', 'MATCH', 'MEMBER', 'MERGE', 'METHOD', 'MODIFIES', | 
| 42 | 42 | 'MODULE', 'MONTH', 'MULTISET', 'NATIONAL', 'NATURAL', 'NCHAR', 'NCLOB', 'NEW', 'NO', 'NONE', 'NOT', | 
| 43 | - 'OF', 'OLD', 'ON', 'ONLY', 'OPEN', 'OR', 'ORDER', 'OUT','OUTER', 'OUTPUT', 'OVER', | |
| 43 | + 'OF', 'OLD', 'ON', 'ONLY', 'OPEN', 'OR', 'ORDER', 'OUT', 'OUTER', 'OUTPUT', 'OVER', | |
| 44 | 44 | 'OVERLAPS', 'PARAMETER', 'PARTITION', 'PRECISION', 'PREPARE', 'PRIMARY', 'PROCEDURE', 'RANGE', 'READS', | 
| 45 | 45 | 'RECURSIVE', 'REF', 'REFERENCES', 'REFERENCING', 'RELEASE', | 
| 46 | 46 | 'REPEAT', 'RESIGNAL', 'RESULT', 'RETURN', 'RETURNS', 'REVOKE', 'RIGHT', 'ROLLBACK', 'ROLLUP', 'ROW', | 
| @@ -59,7 +59,7 @@ | ||
| 59 | 59 |          foreach (array_keys($this->_pending) as $position) { | 
| 60 | 60 | uasort( | 
| 61 | 61 | $this->_tokens[$position], | 
| 62 | - Token::class.'::compare' | |
| 62 | + Token::class . '::compare' | |
| 63 | 63 | ); | 
| 64 | 64 | } | 
| 65 | 65 | $this->_pending = []; | 
| @@ -69,7 +69,7 @@ | ||
| 69 | 69 |                  new CloseRule(new SubStringMatcher(')')), | 
| 70 | 70 | ], | 
| 71 | 71 | |
| 72 | -            'keyword.at-rule' => new Rule(new RegexMatcher('/(@(?:-[a-z]+-)?(?:'.implode('|', $at).'))/'), [ | |
| 72 | +            'keyword.at-rule' => new Rule(new RegexMatcher('/(@(?:-[a-z]+-)?(?:' . implode('|', $at) . '))/'), [ | |
| 73 | 73 | 'priority' => 2 | 
| 74 | 74 | ]), | 
| 75 | 75 | |
| @@ -107,7 +107,7 @@ | ||
| 107 | 107 | public function all() | 
| 108 | 108 |      { | 
| 109 | 109 | $items = $this->getArrayCopy(); | 
| 110 | - if(empty($items)) return []; | |
| 110 | + if (empty($items)) return []; | |
| 111 | 111 | |
| 112 | 112 |          return call_user_func_array('array_merge', $items); | 
| 113 | 113 | } | 
| @@ -151,7 +151,7 @@ | ||
| 151 | 151 | } | 
| 152 | 152 | |
| 153 | 153 | /** | 
| 154 | - * @return Token|null|false | |
| 154 | + * @return Token | |
| 155 | 155 | */ | 
| 156 | 156 | public function getEnd() | 
| 157 | 157 |      { | 
| @@ -178,13 +178,12 @@ discard block | ||
| 178 | 178 | * @return bool Return true to continue processing, false to return already processed tokens. | 
| 179 | 179 | */ | 
| 180 | 180 |      public function process(Context $context, Language $language, Result $result, TokenIterator $tokens) { | 
| 181 | -        if(!$this->isValid($context)) { | |
| 181 | +        if (!$this->isValid($context)) { | |
| 182 | 182 | return true; | 
| 183 | 183 | } | 
| 184 | 184 | |
| 185 | 185 | return $this->isStart() ? | 
| 186 | - $this->processStart($context, $language, $result, $tokens) : | |
| 187 | - $this->processEnd($context, $language, $result, $tokens); | |
| 186 | + $this->processStart($context, $language, $result, $tokens) : $this->processEnd($context, $language, $result, $tokens); | |
| 188 | 187 | } | 
| 189 | 188 | |
| 190 | 189 |      protected function processStart(Context $context, Language $language, Result $result, TokenIterator $tokens) { | 
| @@ -195,7 +194,7 @@ discard block | ||
| 195 | 194 | } | 
| 196 | 195 | |
| 197 | 196 |      protected function processEnd(Context $context, Language $language, Result $result, TokenIterator $tokens) { | 
| 198 | -        if($this->_start) { | |
| 197 | +        if ($this->_start) { | |
| 199 | 198 | $context->pop($this->_start); | 
| 200 | 199 |          } else { | 
| 201 | 200 |              if (($start = $context->find($this->name)) !== false) { | 
| @@ -225,9 +224,9 @@ discard block | ||
| 225 | 224 | return $multiplier; | 
| 226 | 225 | } | 
| 227 | 226 |          } elseif (($rule = Helper::cmp($b->rule->priority, $a->rule->priority)) !== 0) { | 
| 228 | - return $multiplier*$rule; | |
| 229 | -        }  else { | |
| 230 | - return $multiplier*($a->id < $b->id ? -1 : 1); | |
| 227 | + return $multiplier * $rule; | |
| 228 | +        } else { | |
| 229 | + return $multiplier * ($a->id < $b->id ? -1 : 1); | |
| 231 | 230 | } | 
| 232 | 231 | } | 
| 233 | 232 | } | 
| @@ -32,7 +32,7 @@ discard block | ||
| 32 | 32 | |
| 33 | 33 | public function styled($style, $text) | 
| 34 | 34 |      { | 
| 35 | - return $this->open($style).$text.$this->close(); | |
| 35 | + return $this->open($style) . $text . $this->close(); | |
| 36 | 36 | } | 
| 37 | 37 | |
| 38 | 38 | public function open($style) | 
| @@ -51,7 +51,7 @@ discard block | ||
| 51 | 51 |      { | 
| 52 | 52 | $this->_current = empty($this->_stack) ? $this->_default : array_pop($this->_stack); | 
| 53 | 53 | |
| 54 | - return "\033[0m".$this->_set(array_diff_assoc($this->_current, $this->_default)); | |
| 54 | + return "\033[0m" . $this->_set(array_diff_assoc($this->_current, $this->_default)); | |
| 55 | 55 | } | 
| 56 | 56 | |
| 57 | 57 | private function _color($name, $bg = false) | 
| @@ -103,9 +103,9 @@ discard block | ||
| 103 | 103 | |
| 104 | 104 | private function _set($style) | 
| 105 | 105 |      { | 
| 106 | -        $escape = "\e[".implode(';', array_map(function ($style, $name) { | |
| 106 | +        $escape = "\e[" . implode(';', array_map(function($style, $name) { | |
| 107 | 107 | return $this->_style($style, $name); | 
| 108 | - }, array_keys($style), $style)).'m'; | |
| 108 | + }, array_keys($style), $style)) . 'm'; | |
| 109 | 109 | |
| 110 | 110 | return $escape === "\e[m" ? null : $escape; | 
| 111 | 111 | } |