@@ -112,7 +112,7 @@ private function expectRightParenthesis(): void
112
112
if (!$ token || !$ token ->isA (QueryTokenType::T_RPAREN )) {
113
113
$ this ->throwParsingException (
114
114
'token type ` ' . QueryTokenType::T_RPAREN ->value . '` ' ,
115
- '` ' . ($ token[ ' type ' ]-> value ?? 'null ' ) . '` '
115
+ '` ' . ($ token-> type ?? 'null ' ) . '` '
116
116
);
117
117
}
118
118
$ this ->advance ();
@@ -175,7 +175,7 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
175
175
$ this ->validateCurrentTokenNotEmpty ();
176
176
177
177
if (!$ this ->currentToken () || !$ this ->currentToken ()->isA (...self ::FIELD_NAME_TOKENS )) {
178
- $ tokenValue = $ this ->currentToken ()[ ' value ' ] ?? 'null ' ;
178
+ $ tokenValue = $ this ->currentToken ()-> value ?? 'null ' ;
179
179
$ message = null ;
180
180
if (in_arrayi ($ tokenValue , ['and ' , 'or ' , 'like ' , 'not like ' , 'null ' , 'empty ' ])) {
181
181
$ message = sprintf ('Expected %s, found %s. ' , 'a field name ' , '` ' . $ tokenValue . '` ' )
@@ -186,15 +186,15 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
186
186
187
187
/** @var Token $fieldToken */
188
188
$ fieldToken = $ this ->currentToken ();
189
- $ fieldType = $ fieldToken[ ' type ' ] ;
190
- $ field = $ fieldToken[ ' value ' ] ;
189
+ $ fieldType = $ fieldToken-> type ;
190
+ $ field = $ fieldToken-> value ;
191
191
$ this ->advance (); // Move to operator
192
192
$ this ->validateCurrentTokenNotEmpty ();
193
193
194
194
$ operatorToken = $ this ->currentToken ();
195
195
196
196
if ($ operatorToken === null || !$ operatorToken ->isA (...self ::OPERATOR_TOKENS )) {
197
- $ this ->throwParsingException ('a comparison operator ' , '` ' . ( $ operatorToken[ ' value ' ] ?? ' null ' ) . '` ' );
197
+ $ this ->throwParsingException ('a comparison operator ' , '` ' . $ operatorToken-> value . '` ' );
198
198
}
199
199
200
200
$ this ->advance (); // Move to value
@@ -205,7 +205,7 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
205
205
if (!$ valueToken || !$ valueToken ->isA (...self ::VALUE_TOKENS )) {
206
206
$ this ->throwParsingException (
207
207
'a string, numeric value or a empty/null keyword ' ,
208
- '` ' . ( $ valueToken[ ' value ' ] ?? ' null ' ) . '` '
208
+ '` ' . $ valueToken-> value . '` '
209
209
);
210
210
}
211
211
@@ -214,7 +214,7 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
214
214
) {
215
215
$ this ->throwParsingException (
216
216
'a valid value ' ,
217
- '` ' . ( $ valueToken[ ' value ' ] ?? ' null ' ) . '` ' ,
217
+ '` ' . $ valueToken-> value . '` ' ,
218
218
'Operator ` ' . $ operatorToken ->value . '` does not support null/empty values '
219
219
);
220
220
}
@@ -345,7 +345,7 @@ public function parse(): ParseResult
345
345
$ query = $ this ->parseCondition ($ subQueries );
346
346
347
347
if ($ token = $ this ->currentToken ()) {
348
- $ this ->throwParsingException ('end of input ' , '` ' . ( $ token[ ' value ' ] ?? ' null ' ) . '` ' );
348
+ $ this ->throwParsingException ('end of input ' , '` ' . $ token-> value . '` ' );
349
349
}
350
350
351
351
return new ParseResult ($ query , $ subQueries );
0 commit comments