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 705705 $ statement = new Node \Stmt \TypesListNode ($ statement );
706706 break ;
707707 // In case of offset access type
708- case $ child instanceof Node \Stmt \NamedTypeNode :
708+ case $ child instanceof Node \Stmt \TypeStatement :
709709 if ($ this ->offsets === false ) {
710710 throw FeatureNotAllowedException::fromFeature ('square bracket type offsets ' , $ offset );
711711 }
712712
713713 $ statement = new Node \Stmt \TypeOffsetAccessNode ($ statement , $ child );
714714 break ;
715715 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+ ));
717720 }
718721 }
719722
Original file line number Diff line number Diff line change @@ -133,15 +133,18 @@ TypesList -> {
133133 $statement = new Node\Stmt\TypesListNode($statement);
134134 break;
135135 // In case of offset access type
136- case $child instanceof Node\Stmt\NamedTypeNode :
136+ case $child instanceof Node\Stmt\TypeStatement :
137137 if ($this->offsets === false) {
138138 throw FeatureNotAllowedException::fromFeature('square bracket type offsets', $offset);
139139 }
140140
141141 $statement = new Node\Stmt\TypeOffsetAccessNode($statement, $child);
142142 break;
143143 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+ ));
145148 }
146149 }
147150
You can’t perform that action at this time.
0 commit comments