@@ -112,7 +112,7 @@ private function expectRightParenthesis(): void
112112 if (!$ token || !$ token ->isA (QueryTokenType::T_RPAREN )) {
113113 $ this ->throwParsingException (
114114 'token type ` ' . QueryTokenType::T_RPAREN ->value . '` ' ,
115- '` ' . ($ token[ ' type ' ]-> value ?? 'null ' ) . '` '
115+ '` ' . ($ token-> type ?? 'null ' ) . '` '
116116 );
117117 }
118118 $ this ->advance ();
@@ -175,7 +175,7 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
175175 $ this ->validateCurrentTokenNotEmpty ();
176176
177177 if (!$ this ->currentToken () || !$ this ->currentToken ()->isA (...self ::FIELD_NAME_TOKENS )) {
178- $ tokenValue = $ this ->currentToken ()[ ' value ' ] ?? 'null ' ;
178+ $ tokenValue = $ this ->currentToken ()-> value ?? 'null ' ;
179179 $ message = null ;
180180 if (in_arrayi ($ tokenValue , ['and ' , 'or ' , 'like ' , 'not like ' , 'null ' , 'empty ' ])) {
181181 $ message = sprintf ('Expected %s, found %s. ' , 'a field name ' , '` ' . $ tokenValue . '` ' )
@@ -186,15 +186,15 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
186186
187187 /** @var Token $fieldToken */
188188 $ fieldToken = $ this ->currentToken ();
189- $ fieldType = $ fieldToken[ ' type ' ] ;
190- $ field = $ fieldToken[ ' value ' ] ;
189+ $ fieldType = $ fieldToken-> type ;
190+ $ field = $ fieldToken-> value ;
191191 $ this ->advance (); // Move to operator
192192 $ this ->validateCurrentTokenNotEmpty ();
193193
194194 $ operatorToken = $ this ->currentToken ();
195195
196196 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 . '` ' );
198198 }
199199
200200 $ this ->advance (); // Move to value
@@ -205,7 +205,7 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
205205 if (!$ valueToken || !$ valueToken ->isA (...self ::VALUE_TOKENS )) {
206206 $ this ->throwParsingException (
207207 'a string, numeric value or a empty/null keyword ' ,
208- '` ' . ( $ valueToken[ ' value ' ] ?? ' null ' ) . '` '
208+ '` ' . $ valueToken-> value . '` '
209209 );
210210 }
211211
@@ -214,7 +214,7 @@ private function parseComparison(array &$subQueries): array|ParseResultSubQuery
214214 ) {
215215 $ this ->throwParsingException (
216216 'a valid value ' ,
217- '` ' . ( $ valueToken[ ' value ' ] ?? ' null ' ) . '` ' ,
217+ '` ' . $ valueToken-> value . '` ' ,
218218 'Operator ` ' . $ operatorToken ->value . '` does not support null/empty values '
219219 );
220220 }
@@ -345,7 +345,7 @@ public function parse(): ParseResult
345345 $ query = $ this ->parseCondition ($ subQueries );
346346
347347 if ($ token = $ this ->currentToken ()) {
348- $ this ->throwParsingException ('end of input ' , '` ' . ( $ token[ ' value ' ] ?? ' null ' ) . '` ' );
348+ $ this ->throwParsingException ('end of input ' , '` ' . $ token-> value . '` ' );
349349 }
350350
351351 return new ParseResult ($ query , $ subQueries );
0 commit comments