File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 705
705
$ statement = new Node \Stmt \TypesListNode ($ statement );
706
706
break ;
707
707
// In case of offset access type
708
- case $ child instanceof Node \Stmt \NamedTypeNode :
708
+ case $ child instanceof Node \Stmt \TypeStatement :
709
709
if ($ this ->offsets === false ) {
710
710
throw FeatureNotAllowedException::fromFeature ('square bracket type offsets ' , $ offset );
711
711
}
712
712
713
713
$ statement = new Node \Stmt \TypeOffsetAccessNode ($ statement , $ child );
714
714
break ;
715
715
default :
716
- throw new SemanticException ($ offset , 'Unexpected square bracket node type ' );
716
+ throw new SemanticException ($ offset , \sprintf (
717
+ 'Internal error, unexpected square bracket sub-node %s ' ,
718
+ \get_debug_type ($ child ),
719
+ ));
717
720
}
718
721
}
719
722
Original file line number Diff line number Diff line change @@ -133,15 +133,18 @@ TypesList -> {
133
133
$statement = new Node\Stmt\TypesListNode($statement);
134
134
break;
135
135
// In case of offset access type
136
- case $child instanceof Node\Stmt\NamedTypeNode :
136
+ case $child instanceof Node\Stmt\TypeStatement :
137
137
if ($this->offsets === false) {
138
138
throw FeatureNotAllowedException::fromFeature('square bracket type offsets', $offset);
139
139
}
140
140
141
141
$statement = new Node\Stmt\TypeOffsetAccessNode($statement, $child);
142
142
break;
143
143
default:
144
- throw new SemanticException($offset, 'Unexpected square bracket node type');
144
+ throw new SemanticException($offset, \sprintf(
145
+ 'Internal error, unexpected square bracket sub-node %s',
146
+ \get_debug_type($child),
147
+ ));
145
148
}
146
149
}
147
150
You can’t perform that action at this time.
0 commit comments