@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | $this->str = $str; |
80 | 80 | $this->byteLen = mb_strlen($str, '8bit'); |
81 | - if (! mb_check_encoding($str, 'UTF-8')) { |
|
81 | + if (!mb_check_encoding($str, 'UTF-8')) { |
|
82 | 82 | $this->charLen = 0; |
83 | 83 | } else { |
84 | 84 | $this->charLen = mb_strlen($str, 'UTF-8'); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * |
101 | 101 | * @param int $offset the offset to be returned |
102 | 102 | */ |
103 | - public function offsetGet(mixed $offset): string|null |
|
103 | + public function offsetGet(mixed $offset): string | null |
|
104 | 104 | { |
105 | 105 | // This function moves the internal byte and character pointer to the requested offset. |
106 | 106 | // This function is part of hot code so the aim is to do the following |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | final class GroupKeyword implements Component |
19 | 19 | { |
20 | 20 | /** @var 'ASC'|'DESC'|null */ |
21 | - public string|null $type = null; |
|
21 | + public string | null $type = null; |
|
22 | 22 | |
23 | 23 | /** |
24 | 24 | * The expression that is used for grouping. |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | ) { |
89 | 89 | $expr->type = $token->keyword; |
90 | 90 | } elseif (($token->type === TokenType::Operator) && ($token->value === ',')) { |
91 | - if (! empty($expr->expr)) { |
|
91 | + if (!empty($expr->expr)) { |
|
92 | 92 | $ret[] = $expr; |
93 | 93 | } |
94 | 94 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | // Last iteration was not processed. |
104 | - if (! empty($expr->expr)) { |
|
104 | + if (!empty($expr->expr)) { |
|
105 | 105 | $ret[] = $expr; |
106 | 106 | } |
107 | 107 |
@@ -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($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, $value): Token|null |
|
159 | + public function getNextOfTypeAndValue(TokenType $type, $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 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | |
171 | 171 | // Reserved, data types, keys, functions, etc. keywords. |
172 | 172 | foreach (static::$labelsFlags as $label => $flags) { |
173 | - if (! str_contains($value, $label)) { |
|
173 | + if (!str_contains($value, $label)) { |
|
174 | 174 | continue; |
175 | 175 | } |
176 | 176 | |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | $value = strtoupper($value); |
193 | - if (! isset($types[$value])) { |
|
193 | + if (!isset($types[$value])) { |
|
194 | 194 | $types[$value] = $type; |
195 | 195 | } else { |
196 | 196 | $types[$value] |= $type; |
@@ -200,11 +200,11 @@ discard block |
||
200 | 200 | $ret = []; |
201 | 201 | foreach ($types as $word => $type) { |
202 | 202 | $len = strlen($word); |
203 | - if (! isset($ret[$type])) { |
|
203 | + if (!isset($ret[$type])) { |
|
204 | 204 | $ret[$type] = []; |
205 | 205 | } |
206 | 206 | |
207 | - if (! isset($ret[$type][$len])) { |
|
207 | + if (!isset($ret[$type][$len])) { |
|
208 | 208 | $ret[$type][$len] = []; |
209 | 209 | } |
210 | 210 |