@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | } |
57 | 57 | |
58 | 58 | // Flags. |
59 | - return ! isset($pattern['flags']) |
|
60 | - || (! (($pattern['flags'] & $token->flags) === 0)); |
|
59 | + return !isset($pattern['flags']) |
|
60 | + || (!(($pattern['flags'] & $token->flags) === 0)); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | /** |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $isList = $list instanceof TokensList; |
76 | 76 | |
77 | 77 | // Parsing the tokens. |
78 | - if (! $isList) { |
|
78 | + if (!$isList) { |
|
79 | 79 | $list = Lexer::getTokens($list); |
80 | 80 | } |
81 | 81 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | ++$j; |
136 | 136 | } |
137 | 137 | |
138 | - if (! static::match($list->tokens[$j], $find[$k])) { |
|
138 | + if (!static::match($list->tokens[$j], $find[$k])) { |
|
139 | 139 | // This token does not match the pattern. |
140 | 140 | break; |
141 | 141 | } |
@@ -180,7 +180,7 @@ |
||
180 | 180 | } |
181 | 181 | |
182 | 182 | ++$list->idx; |
183 | - if (! isset($list->tokens[$list->idx])) { |
|
183 | + if (!isset($list->tokens[$list->idx])) { |
|
184 | 184 | break; |
185 | 185 | } |
186 | 186 |
@@ -22,7 +22,6 @@ |
||
22 | 22 | |
23 | 23 | /** |
24 | 24 | * `WITH` statement. |
25 | - |
|
26 | 25 | * WITH [RECURSIVE] query_name [ (column_name [,...]) ] AS (SELECT ...) [, ...] |
27 | 26 | */ |
28 | 27 | final class WithStatement extends Statement |
@@ -38,11 +38,11 @@ |
||
38 | 38 | */ |
39 | 39 | public static function build($component, array $options = []) |
40 | 40 | { |
41 | - if (! $component instanceof WithKeyword) { |
|
41 | + if (!$component instanceof WithKeyword) { |
|
42 | 42 | throw new RuntimeException('Can not build a component that is not a WithKeyword'); |
43 | 43 | } |
44 | 44 | |
45 | - if (! isset($component->statement)) { |
|
45 | + if (!isset($component->statement)) { |
|
46 | 46 | throw new RuntimeException('No statement inside WITH'); |
47 | 47 | } |
48 | 48 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | { |
36 | 36 | foreach ($longopts as $value) { |
37 | 37 | $value = rtrim($value, ':'); |
38 | - if (! isset($params[$value])) { |
|
38 | + if (!isset($params[$value])) { |
|
39 | 39 | continue; |
40 | 40 | } |
41 | 41 | |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | } |
84 | 84 | |
85 | 85 | $this->mergeLongOpts($params, $longopts); |
86 | - if (! isset($params['f'])) { |
|
86 | + if (!isset($params['f'])) { |
|
87 | 87 | $params['f'] = 'cli'; |
88 | 88 | } |
89 | 89 | |
90 | - if (! in_array($params['f'], ['html', 'cli', 'text'])) { |
|
90 | + if (!in_array($params['f'], ['html', 'cli', 'text'])) { |
|
91 | 91 | echo "ERROR: Invalid value for format!\n"; |
92 | 92 | |
93 | 93 | return false; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | return 0; |
113 | 113 | } |
114 | 114 | |
115 | - if (! isset($params['q'])) { |
|
115 | + if (!isset($params['q'])) { |
|
116 | 116 | $stdIn = $this->readStdin(); |
117 | 117 | |
118 | 118 | if ($stdIn) { |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | Context::load($params['c']); |
189 | 189 | } |
190 | 190 | |
191 | - if (! isset($params['q'])) { |
|
191 | + if (!isset($params['q'])) { |
|
192 | 192 | $stdIn = $this->readStdin(); |
193 | 193 | |
194 | 194 | if ($stdIn) { |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | return 0; |
265 | 265 | } |
266 | 266 | |
267 | - if (! isset($params['q'])) { |
|
267 | + if (!isset($params['q'])) { |
|
268 | 268 | $stdIn = $this->readStdin(); |
269 | 269 | |
270 | 270 | if ($stdIn) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | // The code below extracts only the relevant information. |
72 | 72 | |
73 | 73 | // Extracting lexer's errors. |
74 | - if (! empty($lexer->errors)) { |
|
74 | + if (!empty($lexer->errors)) { |
|
75 | 75 | foreach ($lexer->errors as $err) { |
76 | 76 | $lexerErrors[] = [ |
77 | 77 | $err->getMessage(), |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | } |
86 | 86 | |
87 | 87 | // Extracting parser's errors. |
88 | - if (! empty($parser->errors)) { |
|
88 | + if (!empty($parser->errors)) { |
|
89 | 89 | foreach ($parser->errors as $err) { |
90 | 90 | $parserErrors[] = [ |
91 | 91 | $err->getMessage(), |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | public static function build($type, $input, $output, $debug = null, $ansi = false) |
123 | 123 | { |
124 | 124 | // Support query types: `lexer` / `parser`. |
125 | - if (! in_array($type, ['lexer', 'parser'])) { |
|
125 | + if (!in_array($type, ['lexer', 'parser'])) { |
|
126 | 126 | throw new Exception('Unknown test type (expected `lexer` or `parser`).'); |
127 | 127 | } |
128 | 128 | |
@@ -184,11 +184,11 @@ discard block |
||
184 | 184 | if (is_dir($inputFile)) { |
185 | 185 | // Creating required directories to maintain the structure. |
186 | 186 | // Ignoring errors if the folder structure exists already. |
187 | - if (! is_dir($outputFile)) { |
|
187 | + if (!is_dir($outputFile)) { |
|
188 | 188 | mkdir($outputFile); |
189 | 189 | } |
190 | 190 | |
191 | - if (($debug !== null) && (! is_dir($debugFile))) { |
|
191 | + if (($debug !== null) && (!is_dir($debugFile))) { |
|
192 | 192 | mkdir($debugFile); |
193 | 193 | } |
194 | 194 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | } |
204 | 204 | |
205 | 205 | // Building the test. |
206 | - if (! file_exists($outputFile)) { |
|
206 | + if (!file_exists($outputFile)) { |
|
207 | 207 | sprintf("Building test for %s...\n", $inputFile); |
208 | 208 | static::build( |
209 | 209 | strpos($inputFile, 'lex') !== false ? 'lexer' : 'parser', |
@@ -278,7 +278,7 @@ |
||
278 | 278 | public static function build($component, array $options = []) |
279 | 279 | { |
280 | 280 | if ($component->dest instanceof Expression) { |
281 | - $columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : ''; |
|
281 | + $columns = !empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : ''; |
|
282 | 282 | |
283 | 283 | return $component->dest . $columns; |
284 | 284 | } |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | } |
196 | 196 | } |
197 | 197 | |
198 | - if (! empty($expr->type)) { |
|
198 | + if (!empty($expr->type)) { |
|
199 | 199 | $ret[] = $expr; |
200 | 200 | } |
201 | 201 | |
@@ -215,9 +215,9 @@ discard block |
||
215 | 215 | $ret = []; |
216 | 216 | foreach ($component as $c) { |
217 | 217 | $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr |
218 | - . (! empty($c->on) |
|
218 | + . (!empty($c->on) |
|
219 | 219 | ? ' ON ' . Condition::build($c->on) : '') |
220 | - . (! empty($c->using) |
|
220 | + . (!empty($c->using) |
|
221 | 221 | ? ' USING ' . ArrayObj::build($c->using) : ''); |
222 | 222 | } |
223 | 223 |
@@ -181,7 +181,7 @@ |
||
181 | 181 | return implode(', ', $component); |
182 | 182 | } |
183 | 183 | |
184 | - if (! empty($component->raw)) { |
|
184 | + if (!empty($component->raw)) { |
|
185 | 185 | return '(' . implode(', ', $component->raw) . ')'; |
186 | 186 | } |
187 | 187 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | if ($state === 1) { |
102 | - if (! $this->isLock) { |
|
102 | + if (!$this->isLock) { |
|
103 | 103 | // UNLOCK statement should not have any more tokens |
104 | 104 | $parser->error('Unexpected token.', $token); |
105 | 105 | break; |