@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * Gets the next token. Skips any irrelevant token (whitespaces and |
| 95 | 95 | * comments). |
| 96 | 96 | */ |
| 97 | - public function getNext(): Token|null |
|
| 97 | + public function getNext(): Token | null |
|
| 98 | 98 | { |
| 99 | 99 | for (; $this->idx < $this->count; ++$this->idx) { |
| 100 | 100 | if ( |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * Gets the previous token. Skips any irrelevant token (whitespaces and |
| 113 | 113 | * comments). |
| 114 | 114 | */ |
| 115 | - public function getPrevious(): Token|null |
|
| 115 | + public function getPrevious(): Token | null |
|
| 116 | 116 | { |
| 117 | 117 | for (; $this->idx >= 0; --$this->idx) { |
| 118 | 118 | if ( |
@@ -131,9 +131,9 @@ discard block |
||
| 131 | 131 | * |
| 132 | 132 | * @param int|int[] $type the type |
| 133 | 133 | */ |
| 134 | - public function getPreviousOfType($type): Token|null |
|
| 134 | + public function getPreviousOfType($type): Token | null |
|
| 135 | 135 | { |
| 136 | - if (! is_array($type)) { |
|
| 136 | + if (!is_array($type)) { |
|
| 137 | 137 | $type = [$type]; |
| 138 | 138 | } |
| 139 | 139 | |
@@ -151,9 +151,9 @@ discard block |
||
| 151 | 151 | * |
| 152 | 152 | * @param int|int[] $type the type |
| 153 | 153 | */ |
| 154 | - public function getNextOfType($type): Token|null |
|
| 154 | + public function getNextOfType($type): Token | null |
|
| 155 | 155 | { |
| 156 | - if (! is_array($type)) { |
|
| 156 | + if (!is_array($type)) { |
|
| 157 | 157 | $type = [$type]; |
| 158 | 158 | } |
| 159 | 159 | |
@@ -172,7 +172,7 @@ discard block |
||
| 172 | 172 | * @param int $type the type of the token |
| 173 | 173 | * @param string $value the value of the token |
| 174 | 174 | */ |
| 175 | - public function getNextOfTypeAndValue($type, $value): Token|null |
|
| 175 | + public function getNextOfTypeAndValue($type, $value): Token | null |
|
| 176 | 176 | { |
| 177 | 177 | for (; $this->idx < $this->count; ++$this->idx) { |
| 178 | 178 | if (($this->tokens[$this->idx]->type === $type) && ($this->tokens[$this->idx]->value === $value)) { |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | * @param int $type the type of the token |
| 190 | 190 | * @param int $flag the flag of the token |
| 191 | 191 | */ |
| 192 | - public function getNextOfTypeAndFlag(int $type, int $flag): Token|null |
|
| 192 | + public function getNextOfTypeAndFlag(int $type, int $flag): Token | null |
|
| 193 | 193 | { |
| 194 | 194 | for (; $this->idx < $this->count; ++$this->idx) { |
| 195 | 195 | if (($this->tokens[$this->idx]->type === $type) && ($this->tokens[$this->idx]->flags === $flag)) { |
@@ -220,7 +220,7 @@ discard block |
||
| 220 | 220 | * |
| 221 | 221 | * @param int $offset the offset to be returned |
| 222 | 222 | */ |
| 223 | - public function offsetGet($offset): Token|null |
|
| 223 | + public function offsetGet($offset): Token | null |
|
| 224 | 224 | { |
| 225 | 225 | return $offset < $this->count ? $this->tokens[$offset] : null; |
| 226 | 226 | } |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | public static function gettext($msgid): string |
| 67 | 67 | { |
| 68 | - if (! class_exists(Loader::class, true)) { |
|
| 68 | + if (!class_exists(Loader::class, true)) { |
|
| 69 | 69 | return $msgid; |
| 70 | 70 | } |
| 71 | 71 | |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | * @param TokensList $list the list of tokens that are being parsed |
| 95 | 95 | * @param array<string, mixed> $options parameters for parsing |
| 96 | 96 | */ |
| 97 | - public static function parse(Parser $parser, TokensList $list, array $options = []): DataType|null |
|
| 97 | + public static function parse(Parser $parser, TokensList $list, array $options = []): DataType | null |
|
| 98 | 98 | { |
| 99 | 99 | $ret = new static(); |
| 100 | 100 | |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | |
| 125 | 125 | if ($state === 0) { |
| 126 | 126 | $ret->name = strtoupper((string) $token->value); |
| 127 | - if (($token->type !== Token::TYPE_KEYWORD) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 127 | + if (($token->type !== Token::TYPE_KEYWORD) || (!($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { |
|
| 128 | 128 | $parser->error('Unrecognized data type.', $token); |
| 129 | 129 | } |
| 130 | 130 | |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | * |
| 50 | 50 | * @return ArrayObj|Component[] |
| 51 | 51 | */ |
| 52 | - public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj|array |
|
| 52 | + public static function parse(Parser $parser, TokensList $list, array $options = []): ArrayObj | array |
|
| 53 | 53 | { |
| 54 | 54 | $ret = empty($options['type']) ? new static() : []; |
| 55 | 55 | |
@@ -47,7 +47,7 @@ |
||
| 47 | 47 | |
| 48 | 48 | public function build(): string |
| 49 | 49 | { |
| 50 | - if (! isset($this->statement)) { |
|
| 50 | + if (!isset($this->statement)) { |
|
| 51 | 51 | throw new RuntimeException('No statement inside WITH'); |
| 52 | 52 | } |
| 53 | 53 | |
@@ -261,7 +261,7 @@ |
||
| 261 | 261 | public function build(): string |
| 262 | 262 | { |
| 263 | 263 | if ($this->dest instanceof Expression) { |
| 264 | - $columns = ! empty($this->columns) ? '(`' . implode('`, `', $this->columns) . '`)' : ''; |
|
| 264 | + $columns = !empty($this->columns) ? '(`' . implode('`, `', $this->columns) . '`)' : ''; |
|
| 265 | 265 | |
| 266 | 266 | return $this->dest . $columns; |
| 267 | 267 | } |
@@ -142,7 +142,7 @@ |
||
| 142 | 142 | public function build(): string |
| 143 | 143 | { |
| 144 | 144 | $tmp = ''; |
| 145 | - if (! empty($this->inOut)) { |
|
| 145 | + if (!empty($this->inOut)) { |
|
| 146 | 146 | $tmp .= $this->inOut . ' '; |
| 147 | 147 | } |
| 148 | 148 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | |
| 109 | 109 | if ($lastOption === null) { |
| 110 | 110 | $upper = strtoupper($token->token); |
| 111 | - if (! isset($options[$upper])) { |
|
| 111 | + if (!isset($options[$upper])) { |
|
| 112 | 112 | // There is no option to be processed. |
| 113 | 113 | break; |
| 114 | 114 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | if ($state === 0) { |
| 148 | - if (! is_array($lastOption)) { |
|
| 148 | + if (!is_array($lastOption)) { |
|
| 149 | 149 | // This is a just keyword option without any value. |
| 150 | 150 | // This is the beginning and the end of it. |
| 151 | 151 | $ret->options[$lastOptionId] = $token->value; |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $ret->options[$lastOptionId]['expr'] .= $token->token; |
| 223 | 223 | |
| 224 | 224 | if ( |
| 225 | - ! (($token->token === '(') && ($brackets === 1) |
|
| 225 | + !(($token->token === '(') && ($brackets === 1) |
|
| 226 | 226 | || (($token->token === ')') && ($brackets === 0))) |
| 227 | 227 | ) { |
| 228 | 228 | // First pair of brackets is being skipped. |
@@ -274,12 +274,12 @@ discard block |
||
| 274 | 274 | |
| 275 | 275 | $options = []; |
| 276 | 276 | foreach ($this->options as $option) { |
| 277 | - if (! is_array($option)) { |
|
| 277 | + if (!is_array($option)) { |
|
| 278 | 278 | $options[] = $option; |
| 279 | 279 | } else { |
| 280 | 280 | $options[] = $option['name'] |
| 281 | - . (! empty($option['equals']) ? '=' : ' ') |
|
| 282 | - . (! empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 281 | + . (!empty($option['equals']) ? '=' : ' ') |
|
| 282 | + . (!empty($option['expr']) ? $option['expr'] : $option['value']); |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | |
@@ -299,10 +299,10 @@ discard block |
||
| 299 | 299 | { |
| 300 | 300 | foreach ($this->options as $option) { |
| 301 | 301 | if (is_array($option)) { |
| 302 | - if (! strcasecmp($key, $option['name'])) { |
|
| 302 | + if (!strcasecmp($key, $option['name'])) { |
|
| 303 | 303 | return $getExpr ? $option['expr'] : $option['value']; |
| 304 | 304 | } |
| 305 | - } elseif (! strcasecmp($key, $option)) { |
|
| 305 | + } elseif (!strcasecmp($key, $option)) { |
|
| 306 | 306 | return true; |
| 307 | 307 | } |
| 308 | 308 | } |
@@ -321,12 +321,12 @@ discard block |
||
| 321 | 321 | { |
| 322 | 322 | foreach ($this->options as $idx => $option) { |
| 323 | 323 | if (is_array($option)) { |
| 324 | - if (! strcasecmp($key, $option['name'])) { |
|
| 324 | + if (!strcasecmp($key, $option['name'])) { |
|
| 325 | 325 | unset($this->options[$idx]); |
| 326 | 326 | |
| 327 | 327 | return true; |
| 328 | 328 | } |
| 329 | - } elseif (! strcasecmp($key, $option)) { |
|
| 329 | + } elseif (!strcasecmp($key, $option)) { |
|
| 330 | 330 | unset($this->options[$idx]); |
| 331 | 331 | |
| 332 | 332 | return true; |
@@ -179,9 +179,9 @@ discard block |
||
| 179 | 179 | } elseif ($state === 1) { |
| 180 | 180 | if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { |
| 181 | 181 | $positionBeforeSearch = $list->idx; |
| 182 | - $list->idx++;// Ignore the current token "(" or the search condition will always be true |
|
| 182 | + $list->idx++; // Ignore the current token "(" or the search condition will always be true |
|
| 183 | 183 | $nextToken = $list->getNext(); |
| 184 | - $list->idx = $positionBeforeSearch;// Restore the position |
|
| 184 | + $list->idx = $positionBeforeSearch; // Restore the position |
|
| 185 | 185 | |
| 186 | 186 | if ($nextToken !== null && $nextToken->value === '(') { |
| 187 | 187 | // Switch to expression mode |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | if ($token->type === Token::TYPE_OPERATOR) { |
| 231 | 231 | // This got back to here and we reached the end of the expression |
| 232 | 232 | if ($token->value === ')') { |
| 233 | - $state = 4;// go back to state 4 to fetch options |
|
| 233 | + $state = 4; // go back to state 4 to fetch options |
|
| 234 | 234 | continue; |
| 235 | 235 | } |
| 236 | 236 | |
@@ -266,7 +266,7 @@ discard block |
||
| 266 | 266 | public function build(): string |
| 267 | 267 | { |
| 268 | 268 | $ret = $this->type . ' '; |
| 269 | - if (! empty($this->name)) { |
|
| 269 | + if (!empty($this->name)) { |
|
| 270 | 270 | $ret .= Context::escape($this->name) . ' '; |
| 271 | 271 | } |
| 272 | 272 | |