@@ -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 = []; |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | $this->_validator = new Validator($context); |
| 72 | 72 | } elseif(is_callable($context)) { |
| 73 | 73 | $this->_validator = new DelegateValidator($context); |
| 74 | - }elseif($context instanceof Validator) { |
|
| 74 | + } elseif($context instanceof Validator) { |
|
| 75 | 75 | $this->_validator = $context; |
| 76 | 76 | } else { |
| 77 | 77 | throw new \InvalidArgumentException('$context must be valid Validator'); |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | 'enabled' => true |
| 61 | 61 | ], $options); |
| 62 | 62 | |
| 63 | - if(isset($options['context'])) { |
|
| 63 | + if (isset($options['context'])) { |
|
| 64 | 64 | $this->setContext($options['context']); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -71,11 +71,11 @@ discard block |
||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function setContext($context) { |
| 74 | - if(is_array($context)) { |
|
| 74 | + if (is_array($context)) { |
|
| 75 | 75 | $this->validator = new Validator($context); |
| 76 | - } elseif(is_callable($context)) { |
|
| 76 | + } elseif (is_callable($context)) { |
|
| 77 | 77 | $this->validator = new DelegateValidator($context); |
| 78 | - }elseif($context instanceof Validator) { |
|
| 78 | + }elseif ($context instanceof Validator) { |
|
| 79 | 79 | $this->validator = $context; |
| 80 | 80 | } else { |
| 81 | 81 | throw new \InvalidArgumentException('$context must be valid Validator'); |
@@ -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 | } |
@@ -107,7 +107,9 @@ |
||
| 107 | 107 | public function all() |
| 108 | 108 | { |
| 109 | 109 | $items = $this->getArrayCopy(); |
| 110 | - if(empty($items)) return []; |
|
| 110 | + if(empty($items)) { |
|
| 111 | + return []; |
|
| 112 | + } |
|
| 111 | 113 | |
| 112 | 114 | return call_user_func_array('array_merge', $items); |
| 113 | 115 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | ]); |
| 100 | 100 | |
| 101 | 101 | for ($tokens->next(); $tokens->valid(); $tokens->next()) { |
| 102 | - if(!$tokens->current()->process($context, $this, $result, $tokens)) { |
|
| 102 | + if (!$tokens->current()->process($context, $this, $result, $tokens)) { |
|
| 103 | 103 | break; |
| 104 | 104 | } |
| 105 | 105 | } |
@@ -149,8 +149,8 @@ discard block |
||
| 149 | 149 | private function _rules($embedded = false) |
| 150 | 150 | { |
| 151 | 151 | $rules = clone $this->rules; |
| 152 | - if(is_bool($embedded)) { |
|
| 153 | - $rules->addMany(['language.'.$this->getIdentifier() => $this->getEnds($embedded)]); |
|
| 152 | + if (is_bool($embedded)) { |
|
| 153 | + $rules->addMany(['language.' . $this->getIdentifier() => $this->getEnds($embedded)]); |
|
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | foreach ($rules->all() as $rule) { |