@@ -454,7 +454,7 @@ private function syntaxError(string $expected, ?array $token = null): Annotation
454
454
$ message = sprintf ('Expected %s, got ' , $ expected );
455
455
$ message .= $ this ->lexer ->lookahead === null
456
456
? 'end of string '
457
- : sprintf ("'%s' at position %s " , $ token[ ' value ' ] , $ token[ ' position ' ] );
457
+ : sprintf ("'%s' at position %s " , $ token-> value , $ token-> position );
458
458
459
459
if (strlen ($ this ->context )) {
460
460
$ message .= ' in ' . $ this ->context ;
@@ -684,16 +684,16 @@ private function Annotations(): array
684
684
$ annotations = [];
685
685
686
686
while ($ this ->lexer ->lookahead !== null ) {
687
- if ($ this ->lexer ->lookahead [ ' type ' ] !== DocLexer::T_AT ) {
687
+ if ($ this ->lexer ->lookahead -> type !== DocLexer::T_AT ) {
688
688
$ this ->lexer ->moveNext ();
689
689
continue ;
690
690
}
691
691
692
692
// make sure the @ is preceded by non-catchable pattern
693
693
if (
694
694
$ this ->lexer ->token !== null &&
695
- $ this ->lexer ->lookahead [ ' position ' ] === $ this ->lexer ->token [ ' position ' ] + strlen (
696
- $ this ->lexer ->token [ ' value ' ]
695
+ $ this ->lexer ->lookahead -> position === $ this ->lexer ->token -> position + strlen (
696
+ $ this ->lexer ->token -> value
697
697
)
698
698
) {
699
699
$ this ->lexer ->moveNext ();
@@ -705,12 +705,12 @@ private function Annotations(): array
705
705
$ peek = $ this ->lexer ->glimpse ();
706
706
if (
707
707
($ peek === null )
708
- || ($ peek[ ' type ' ] !== DocLexer::T_NAMESPACE_SEPARATOR && ! in_array (
709
- $ peek[ ' type ' ] ,
708
+ || ($ peek-> type !== DocLexer::T_NAMESPACE_SEPARATOR && ! in_array (
709
+ $ peek-> type ,
710
710
self ::$ classIdentifiers ,
711
711
true
712
712
))
713
- || $ peek[ ' position ' ] !== $ this ->lexer ->lookahead [ ' position ' ] + 1
713
+ || $ peek-> position !== $ this ->lexer ->lookahead -> position + 1
714
714
) {
715
715
$ this ->lexer ->moveNext ();
716
716
continue ;
@@ -1186,18 +1186,18 @@ private function Identifier(): string
1186
1186
1187
1187
$ this ->lexer ->moveNext ();
1188
1188
1189
- $ className = $ this ->lexer ->token [ ' value ' ] ;
1189
+ $ className = $ this ->lexer ->token -> value ;
1190
1190
1191
1191
while (
1192
1192
$ this ->lexer ->lookahead !== null &&
1193
- $ this ->lexer ->lookahead [ ' position ' ] === ($ this ->lexer ->token [ ' position ' ] +
1194
- strlen ($ this ->lexer ->token [ ' value ' ] )) &&
1193
+ $ this ->lexer ->lookahead -> position === ($ this ->lexer ->token -> position +
1194
+ strlen ($ this ->lexer ->token -> value )) &&
1195
1195
$ this ->lexer ->isNextToken (DocLexer::T_NAMESPACE_SEPARATOR )
1196
1196
) {
1197
1197
$ this ->match (DocLexer::T_NAMESPACE_SEPARATOR );
1198
1198
$ this ->matchAny (self ::$ classIdentifiers );
1199
1199
1200
- $ className .= '\\' . $ this ->lexer ->token [ ' value ' ] ;
1200
+ $ className .= '\\' . $ this ->lexer ->token -> value ;
1201
1201
}
1202
1202
1203
1203
return $ className ;
@@ -1215,7 +1215,7 @@ private function Value()
1215
1215
{
1216
1216
$ peek = $ this ->lexer ->glimpse ();
1217
1217
1218
- if ($ peek[ ' type ' ] === DocLexer::T_EQUALS ) {
1218
+ if ($ peek-> type === DocLexer::T_EQUALS ) {
1219
1219
return $ this ->FieldAssignment ();
1220
1220
}
1221
1221
@@ -1244,21 +1244,21 @@ private function PlainValue()
1244
1244
return $ this ->Constant ();
1245
1245
}
1246
1246
1247
- switch ($ this ->lexer ->lookahead [ ' type ' ] ) {
1247
+ switch ($ this ->lexer ->lookahead -> type ) {
1248
1248
case DocLexer::T_STRING :
1249
1249
$ this ->match (DocLexer::T_STRING );
1250
1250
1251
- return $ this ->lexer ->token [ ' value ' ] ;
1251
+ return $ this ->lexer ->token -> value ;
1252
1252
1253
1253
case DocLexer::T_INTEGER :
1254
1254
$ this ->match (DocLexer::T_INTEGER );
1255
1255
1256
- return (int ) $ this ->lexer ->token [ ' value ' ] ;
1256
+ return (int ) $ this ->lexer ->token -> value ;
1257
1257
1258
1258
case DocLexer::T_FLOAT :
1259
1259
$ this ->match (DocLexer::T_FLOAT );
1260
1260
1261
- return (float ) $ this ->lexer ->token [ ' value ' ] ;
1261
+ return (float ) $ this ->lexer ->token -> value ;
1262
1262
1263
1263
case DocLexer::T_TRUE :
1264
1264
$ this ->match (DocLexer::T_TRUE );
@@ -1290,7 +1290,7 @@ private function PlainValue()
1290
1290
private function FieldAssignment (): stdClass
1291
1291
{
1292
1292
$ this ->match (DocLexer::T_IDENTIFIER );
1293
- $ fieldName = $ this ->lexer ->token [ ' value ' ] ;
1293
+ $ fieldName = $ this ->lexer ->token -> value ;
1294
1294
1295
1295
$ this ->match (DocLexer::T_EQUALS );
1296
1296
@@ -1365,14 +1365,14 @@ private function ArrayEntry(): array
1365
1365
$ peek = $ this ->lexer ->glimpse ();
1366
1366
1367
1367
if (
1368
- $ peek[ ' type ' ] === DocLexer::T_EQUALS
1369
- || $ peek[ ' type ' ] === DocLexer::T_COLON
1368
+ $ peek-> type === DocLexer::T_EQUALS
1369
+ || $ peek-> type === DocLexer::T_COLON
1370
1370
) {
1371
1371
if ($ this ->lexer ->isNextToken (DocLexer::T_IDENTIFIER )) {
1372
1372
$ key = $ this ->Constant ();
1373
1373
} else {
1374
1374
$ this ->matchAny ([DocLexer::T_INTEGER , DocLexer::T_STRING ]);
1375
- $ key = $ this ->lexer ->token [ ' value ' ] ;
1375
+ $ key = $ this ->lexer ->token -> value ;
1376
1376
}
1377
1377
1378
1378
$ this ->matchAny ([DocLexer::T_EQUALS , DocLexer::T_COLON ]);
0 commit comments