@@ -54,7 +54,7 @@ |
||
54 | 54 | |
55 | 55 | /** @param GroupKeyword|array<GroupKeyword> $component */ |
56 | 56 | #[DataProvider('provideExpressions')] |
57 | - public function testBuild(GroupKeyword|array $component, string $expected): void |
|
57 | + public function testBuild(GroupKeyword | array $component, string $expected): void |
|
58 | 58 | { |
59 | 59 | if (is_array($component)) { |
60 | 60 | $this->assertSame($expected, GroupKeywords::buildAll($component)); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * @param Expression $expr the expression that we are sorting by |
30 | 30 | * @param string $type the sorting type |
31 | 31 | */ |
32 | - public function __construct(Expression|null $expr = null, string $type = 'ASC') |
|
32 | + public function __construct(Expression | null $expr = null, string $type = 'ASC') |
|
33 | 33 | { |
34 | 34 | $this->expr = $expr; |
35 | 35 | $this->type = $type; |
@@ -32,7 +32,7 @@ |
||
32 | 32 | public $expr; |
33 | 33 | |
34 | 34 | /** @param string $expr the condition or the operator */ |
35 | - public function __construct(string|null $expr = null) |
|
35 | + public function __construct(string | null $expr = null) |
|
36 | 36 | { |
37 | 37 | $this->expr = trim((string) $expr); |
38 | 38 | } |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | * @param ArrayObj $using columns joined |
75 | 75 | */ |
76 | 76 | public function __construct( |
77 | - string|null $type = null, |
|
78 | - Expression|null $expr = null, |
|
79 | - array|null $on = null, |
|
80 | - ArrayObj|null $using = null, |
|
77 | + string | null $type = null, |
|
78 | + Expression | null $expr = null, |
|
79 | + array | null $on = null, |
|
80 | + ArrayObj | null $using = null, |
|
81 | 81 | ) { |
82 | 82 | $this->type = $type; |
83 | 83 | $this->expr = $expr; |
@@ -88,8 +88,8 @@ discard block |
||
88 | 88 | public function build(): string |
89 | 89 | { |
90 | 90 | return array_search($this->type, self::JOINS) . ' ' . $this->expr |
91 | - . (! empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') |
|
92 | - . (! empty($this->using) ? ' USING ' . $this->using->build() : ''); |
|
91 | + . (!empty($this->on) ? ' ON ' . Conditions::buildAll($this->on) : '') |
|
92 | + . (!empty($this->using) ? ' USING ' . $this->using->build() : ''); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | public function __toString(): string |
@@ -29,7 +29,7 @@ |
||
29 | 29 | * @param Expression $old old expression |
30 | 30 | * @param Expression $new new expression containing new name |
31 | 31 | */ |
32 | - public function __construct(Expression|null $old = null, Expression|null $new = null) |
|
32 | + public function __construct(Expression | null $old = null, Expression | null $new = null) |
|
33 | 33 | { |
34 | 34 | $this->old = $old; |
35 | 35 | $this->new = $new; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | final class GroupKeyword implements Component |
15 | 15 | { |
16 | 16 | /** @var 'ASC'|'DESC'|null */ |
17 | - public string|null $type = null; |
|
17 | + public string | null $type = null; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * The expression that is used for grouping. |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public $expr; |
25 | 25 | |
26 | 26 | /** @param Expression $expr the expression that we are sorting by */ |
27 | - public function __construct(Expression|null $expr = null) |
|
27 | + public function __construct(Expression | null $expr = null) |
|
28 | 28 | { |
29 | 29 | $this->expr = $expr; |
30 | 30 | } |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | * @param Reference|null $references references |
67 | 67 | */ |
68 | 68 | public function __construct( |
69 | - string|null $name = null, |
|
70 | - OptionsArray|null $options = null, |
|
71 | - DataType|Key|null $type = null, |
|
69 | + string | null $name = null, |
|
70 | + OptionsArray | null $options = null, |
|
71 | + DataType | Key | null $type = null, |
|
72 | 72 | bool $isConstraint = false, |
73 | - Reference|null $references = null, |
|
73 | + Reference | null $references = null, |
|
74 | 74 | ) { |
75 | 75 | $this->name = $name; |
76 | 76 | $this->options = $options; |
@@ -95,16 +95,16 @@ discard block |
||
95 | 95 | $tmp .= Context::escape($this->name) . ' '; |
96 | 96 | } |
97 | 97 | |
98 | - if (! empty($this->type)) { |
|
98 | + if (!empty($this->type)) { |
|
99 | 99 | $this->type->lowercase = true; |
100 | 100 | $tmp .= $this->type->build() . ' '; |
101 | 101 | } |
102 | 102 | |
103 | - if (! empty($this->key)) { |
|
103 | + if (!empty($this->key)) { |
|
104 | 104 | $tmp .= $this->key . ' '; |
105 | 105 | } |
106 | 106 | |
107 | - if (! empty($this->references)) { |
|
107 | + if (!empty($this->references)) { |
|
108 | 108 | $tmp .= 'REFERENCES ' . $this->references . ' '; |
109 | 109 | } |
110 | 110 |
@@ -62,23 +62,23 @@ discard block |
||
62 | 62 | * |
63 | 63 | * @see Statement::$statementOptions |
64 | 64 | */ |
65 | - public OptionsArray|null $options = null; |
|
65 | + public OptionsArray | null $options = null; |
|
66 | 66 | |
67 | 67 | /** |
68 | 68 | * The index of the first token used in this statement. |
69 | 69 | */ |
70 | - public int|null $first = null; |
|
70 | + public int | null $first = null; |
|
71 | 71 | |
72 | 72 | /** |
73 | 73 | * The index of the last token used in this statement. |
74 | 74 | */ |
75 | - public int|null $last = null; |
|
75 | + public int | null $last = null; |
|
76 | 76 | |
77 | 77 | /** |
78 | 78 | * @param Parser|null $parser the instance that requests parsing |
79 | 79 | * @param TokensList|null $list the list of tokens to be parsed |
80 | 80 | */ |
81 | - public function __construct(Parser|null $parser = null, TokensList|null $list = null) |
|
81 | + public function __construct(Parser | null $parser = null, TokensList | null $list = null) |
|
82 | 82 | { |
83 | 83 | if (($parser === null) || ($list === null)) { |
84 | 84 | return; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | |
128 | 128 | // Checking if this field was already built. |
129 | 129 | if ($type & self::ADD_CLAUSE) { |
130 | - if (! empty($built[$field])) { |
|
130 | + if (!empty($built[$field])) { |
|
131 | 131 | continue; |
132 | 132 | } |
133 | 133 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | // Checking if the result of the builder should be added. |
143 | - if (! ($type & self::ADD_CLAUSE)) { |
|
143 | + if (!($type & self::ADD_CLAUSE)) { |
|
144 | 144 | continue; |
145 | 145 | } |
146 | 146 | |
@@ -265,8 +265,8 @@ discard block |
||
265 | 265 | $options = []; |
266 | 266 | |
267 | 267 | // Looking for duplicated clauses. |
268 | - if (! empty(Parser::KEYWORD_PARSERS[$token->value]) || ! empty(Parser::STATEMENT_PARSERS[$token->value])) { |
|
269 | - if (! empty($parsedClauses[$token->value])) { |
|
268 | + if (!empty(Parser::KEYWORD_PARSERS[$token->value]) || !empty(Parser::STATEMENT_PARSERS[$token->value])) { |
|
269 | + if (!empty($parsedClauses[$token->value])) { |
|
270 | 270 | $parser->error('This type of clause was previously parsed.', $token); |
271 | 271 | break; |
272 | 272 | } |
@@ -279,18 +279,18 @@ discard block |
||
279 | 279 | // but it might be the beginning of a statement of truncate, |
280 | 280 | // so let the value use the keyword field for truncate type. |
281 | 281 | $tokenValue = in_array($token->keyword, ['TRUNCATE']) ? $token->keyword : $token->value; |
282 | - if (! empty(Parser::KEYWORD_PARSERS[$tokenValue]) && $list->idx < $list->count) { |
|
282 | + if (!empty(Parser::KEYWORD_PARSERS[$tokenValue]) && $list->idx < $list->count) { |
|
283 | 283 | $class = Parser::KEYWORD_PARSERS[$tokenValue]['class']; |
284 | 284 | $field = Parser::KEYWORD_PARSERS[$tokenValue]['field']; |
285 | - if (! empty(Parser::KEYWORD_PARSERS[$tokenValue]['options'])) { |
|
285 | + if (!empty(Parser::KEYWORD_PARSERS[$tokenValue]['options'])) { |
|
286 | 286 | $options = Parser::KEYWORD_PARSERS[$tokenValue]['options']; |
287 | 287 | } |
288 | 288 | } |
289 | 289 | |
290 | 290 | // Checking if this is the beginning of the statement. |
291 | - if (! empty(Parser::STATEMENT_PARSERS[$token->keyword])) { |
|
291 | + if (!empty(Parser::STATEMENT_PARSERS[$token->keyword])) { |
|
292 | 292 | if ( |
293 | - ! empty(static::$clauses) // Undefined for some statements. |
|
293 | + !empty(static::$clauses) // Undefined for some statements. |
|
294 | 294 | && empty(static::$clauses[$token->value]) |
295 | 295 | ) { |
296 | 296 | // Some keywords (e.g. `SET`) may be the beginning of a |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | break; |
306 | 306 | } |
307 | 307 | |
308 | - if (! $parsedOptions) { |
|
308 | + if (!$parsedOptions) { |
|
309 | 309 | if (empty(static::$statementOptions[$token->value])) { |
310 | 310 | // Skipping keyword because if it is not a option. |
311 | 311 | ++$list->idx; |
@@ -477,7 +477,7 @@ discard block |
||
477 | 477 | if ($minJoin === 0 && stripos($clauseType, 'JOIN')) { |
478 | 478 | // First JOIN clause is detected |
479 | 479 | $minJoin = $maxJoin = $clauseStartIdx; |
480 | - } elseif ($minJoin !== 0 && ! stripos($clauseType, 'JOIN')) { |
|
480 | + } elseif ($minJoin !== 0 && !stripos($clauseType, 'JOIN')) { |
|
481 | 481 | // After a previous JOIN clause, a non-JOIN clause has been detected |
482 | 482 | $maxJoin = $lastIdx; |
483 | 483 | } elseif ($maxJoin < $clauseStartIdx && stripos($clauseType, 'JOIN')) { |
@@ -18,5 +18,5 @@ |
||
18 | 18 | * |
19 | 19 | * @return Component|Component[]|null |
20 | 20 | */ |
21 | - public static function parse(Parser $parser, TokensList $list, array $options = []): Component|array|null; |
|
21 | + public static function parse(Parser $parser, TokensList $list, array $options = []): Component | array | null; |
|
22 | 22 | } |