@@ -117,7 +117,7 @@ |
||
117 | 117 | 'opts' => [], |
118 | 118 | ]; |
119 | 119 | |
120 | - if (! empty($statement->parameters)) { |
|
120 | + if (!empty($statement->parameters)) { |
|
121 | 121 | $idx = 0; |
122 | 122 | foreach ($statement->parameters as $param) { |
123 | 123 | $retval['dir'][$idx] = $param->inOut; |
@@ -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; |
@@ -27,15 +27,15 @@ |
||
27 | 27 | $debug = empty($argv[3]) ? null : rtrim($argv[3], '/'); |
28 | 28 | |
29 | 29 | // Checking if all directories are valid. |
30 | -if (! is_dir($input)) { |
|
30 | +if (!is_dir($input)) { |
|
31 | 31 | throw new Exception('The input directory does not exist.'); |
32 | 32 | } |
33 | 33 | |
34 | -if (! is_dir($output)) { |
|
34 | +if (!is_dir($output)) { |
|
35 | 35 | throw new Exception('The output directory does not exist.'); |
36 | 36 | } |
37 | 37 | |
38 | -if (($debug !== null) && (! is_dir($debug))) { |
|
38 | +if (($debug !== null) && (!is_dir($debug))) { |
|
39 | 39 | throw new Exception('The debug directory does not exist.'); |
40 | 40 | } |
41 | 41 |
@@ -26,11 +26,11 @@ |
||
26 | 26 | $output = rtrim($argv[2], '/'); |
27 | 27 | |
28 | 28 | // Checking if all directories are valid. |
29 | -if (! is_dir($input)) { |
|
29 | +if (!is_dir($input)) { |
|
30 | 30 | throw new Exception('The input directory does not exist.'); |
31 | 31 | } |
32 | 32 | |
33 | -if (! is_dir($output)) { |
|
33 | +if (!is_dir($output)) { |
|
34 | 34 | throw new Exception('The output directory does not exist.'); |
35 | 35 | } |
36 | 36 |
@@ -86,7 +86,7 @@ |
||
86 | 86 | * Test access to string. |
87 | 87 | */ |
88 | 88 | #[DataProvider('utf8StringsProvider')] |
89 | - public function testAccess(string $text, string|null $pos10, string|null $pos20): void |
|
89 | + public function testAccess(string $text, string | null $pos10, string | null $pos20): void |
|
90 | 90 | { |
91 | 91 | $str = new UtfString($text); |
92 | 92 | $this->assertEquals($pos10, $str->offsetGet(10)); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | $this->assertEquals([ |
44 | 44 | TokenType::Keyword->value | Token::FLAG_KEYWORD_RESERVED => [ |
45 | 45 | 8 => ['RESERVED'], |
46 | - 9 => ['RESERVED2','RESERVED3','RESERVED4','RESERVED5'], |
|
46 | + 9 => ['RESERVED2', 'RESERVED3', 'RESERVED4', 'RESERVED5'], |
|
47 | 47 | ], |
48 | 48 | TokenType::Keyword->value | Token::FLAG_KEYWORD_FUNCTION => [8 => ['FUNCTION']], |
49 | 49 | TokenType::Keyword->value | Token::FLAG_KEYWORD_DATA_TYPE => [8 => ['DATATYPE']], |
@@ -435,7 +435,7 @@ discard block |
||
435 | 435 | // The options of a clause should stay on the same line and everything that follows. |
436 | 436 | if ( |
437 | 437 | $this->options['parts_newline'] |
438 | - && ! $formattedOptions |
|
438 | + && !$formattedOptions |
|
439 | 439 | && empty(self::$inlineClauses[$lastClause]) |
440 | 440 | && ( |
441 | 441 | $curr->type !== TokenType::Keyword |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | end($blocksLineEndings) === true |
493 | 493 | || ( |
494 | 494 | empty(self::$inlineClauses[$lastClause]) |
495 | - && ! $shortGroup |
|
495 | + && !$shortGroup |
|
496 | 496 | && $this->options['parts_newline'] |
497 | 497 | ) |
498 | 498 | ) { |
@@ -528,7 +528,7 @@ discard block |
||
528 | 528 | $lineEnded = false; |
529 | 529 | } elseif ( |
530 | 530 | $prev->keyword === 'DELIMITER' |
531 | - || ! ( |
|
531 | + || !( |
|
532 | 532 | ($prev->type === TokenType::Operator && ($prev->value === '.' || $prev->value === '(')) |
533 | 533 | // No space after . ( |
534 | 534 | || ($curr->type === TokenType::Operator |
@@ -643,13 +643,13 @@ discard block |
||
643 | 643 | |
644 | 644 | foreach ($this->options['formats'] as $format) { |
645 | 645 | if ( |
646 | - $token->type->value !== $format['type'] || ! (($token->flags & $format['flags']) === $format['flags']) |
|
646 | + $token->type->value !== $format['type'] || !(($token->flags & $format['flags']) === $format['flags']) |
|
647 | 647 | ) { |
648 | 648 | continue; |
649 | 649 | } |
650 | 650 | |
651 | 651 | // Running transformation function. |
652 | - if (! empty($format['function'])) { |
|
652 | + if (!empty($format['function'])) { |
|
653 | 653 | $func = $format['function']; |
654 | 654 | $text = $func($text); |
655 | 655 | } |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | * |
759 | 759 | * @psalm-return 1|2|false |
760 | 760 | */ |
761 | - public static function isClause(Token $token): int|false |
|
761 | + public static function isClause(Token $token): int | false |
|
762 | 762 | { |
763 | 763 | if ( |
764 | 764 | ($token->type === TokenType::Keyword && isset(Parser::STATEMENT_PARSERS[$token->keyword])) |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public static function getForeignKeys(CreateStatement $statement): array |
32 | 32 | { |
33 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
33 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
34 | 34 | return []; |
35 | 35 | } |
36 | 36 | |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | |
44 | 44 | $columns = []; |
45 | 45 | foreach ($field->key->columns as $column) { |
46 | - if (! isset($column['name'])) { |
|
46 | + if (!isset($column['name'])) { |
|
47 | 47 | continue; |
48 | 48 | } |
49 | 49 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'index_list' => $columns, |
56 | 56 | ]; |
57 | 57 | |
58 | - if (! empty($field->references)) { |
|
58 | + if (!empty($field->references)) { |
|
59 | 59 | $tmp['ref_db_name'] = $field->references->table->database; |
60 | 60 | $tmp['ref_table_name'] = $field->references->table->table; |
61 | 61 | $tmp['ref_index_list'] = $field->references->columns; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public static function getFields(CreateStatement $statement): array |
98 | 98 | { |
99 | - if (empty($statement->fields) || (! is_array($statement->fields)) || (! $statement->options->has('TABLE'))) { |
|
99 | + if (empty($statement->fields) || (!is_array($statement->fields)) || (!$statement->options->has('TABLE'))) { |
|
100 | 100 | return []; |
101 | 101 | } |
102 | 102 | |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | 'timestamp_not_null' => false, |
114 | 114 | ]; |
115 | 115 | |
116 | - if (! $field->options) { |
|
116 | + if (!$field->options) { |
|
117 | 117 | continue; |
118 | 118 | } |
119 | 119 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | |
141 | 141 | $option = $field->options->has('AS'); |
142 | 142 | |
143 | - if (! $option) { |
|
143 | + if (!$option) { |
|
144 | 144 | continue; |
145 | 145 | } |
146 | 146 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * Gets the next token. Skips any irrelevant token (whitespaces and |
79 | 79 | * comments). |
80 | 80 | */ |
81 | - public function getNext(): Token|null |
|
81 | + public function getNext(): Token | null |
|
82 | 82 | { |
83 | 83 | for (; $this->idx < $this->count; ++$this->idx) { |
84 | 84 | if ( |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | * Gets the previous token. Skips any irrelevant token (whitespaces and |
97 | 97 | * comments). |
98 | 98 | */ |
99 | - public function getPrevious(): Token|null |
|
99 | + public function getPrevious(): Token | null |
|
100 | 100 | { |
101 | 101 | for (; $this->idx >= 0; --$this->idx) { |
102 | 102 | if ( |
@@ -115,9 +115,9 @@ discard block |
||
115 | 115 | * |
116 | 116 | * @param TokenType|TokenType[] $type the type |
117 | 117 | */ |
118 | - public function getPreviousOfType(TokenType|array $type): Token|null |
|
118 | + public function getPreviousOfType(TokenType | array $type): Token | null |
|
119 | 119 | { |
120 | - if (! is_array($type)) { |
|
120 | + if (!is_array($type)) { |
|
121 | 121 | $type = [$type]; |
122 | 122 | } |
123 | 123 | |
@@ -135,9 +135,9 @@ discard block |
||
135 | 135 | * |
136 | 136 | * @param TokenType|TokenType[] $type the type |
137 | 137 | */ |
138 | - public function getNextOfType(TokenType|array $type): Token|null |
|
138 | + public function getNextOfType(TokenType | array $type): Token | null |
|
139 | 139 | { |
140 | - if (! is_array($type)) { |
|
140 | + if (!is_array($type)) { |
|
141 | 141 | $type = [$type]; |
142 | 142 | } |
143 | 143 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | * @param TokenType $type the type of the token |
157 | 157 | * @param string $value the value of the token |
158 | 158 | */ |
159 | - public function getNextOfTypeAndValue(TokenType $type, string $value): Token|null |
|
159 | + public function getNextOfTypeAndValue(TokenType $type, string $value): Token | null |
|
160 | 160 | { |
161 | 161 | for (; $this->idx < $this->count; ++$this->idx) { |
162 | 162 | if (($this->tokens[$this->idx]->type === $type) && ($this->tokens[$this->idx]->value === $value)) { |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | * @param TokenType $type the type of the token |
174 | 174 | * @param int $flag the flag of the token |
175 | 175 | */ |
176 | - public function getNextOfTypeAndFlag(TokenType $type, int $flag): Token|null |
|
176 | + public function getNextOfTypeAndFlag(TokenType $type, int $flag): Token | null |
|
177 | 177 | { |
178 | 178 | for (; $this->idx < $this->count; ++$this->idx) { |
179 | 179 | if (($this->tokens[$this->idx]->type === $type) && ($this->tokens[$this->idx]->flags === $flag)) { |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * |
205 | 205 | * @param int $offset the offset to be returned |
206 | 206 | */ |
207 | - public function offsetGet(mixed $offset): Token|null |
|
207 | + public function offsetGet(mixed $offset): Token | null |
|
208 | 208 | { |
209 | 209 | return $offset < $this->count ? $this->tokens[$offset] : null; |
210 | 210 | } |