@@ -785,62 +785,6 @@ private function parseArrayShape(TokenIterator $tokens, Ast\Type\TypeNode $type,
785785 return new Ast \Type \ArrayShapeNode ($ items , $ sealed , $ kind );
786786 }
787787
788-
789- /**
790- * @phpstan-impure
791- * @param Ast\Type\ArrayShapeNode::KIND_* $kind
792- */
793- private function parseArrayShape_bak (TokenIterator $ tokens , Ast \Type \TypeNode $ type , string $ kind ): Ast \Type \ArrayShapeNode
794- {
795- $ tokens ->consumeTokenType (Lexer::TOKEN_OPEN_CURLY_BRACKET );
796-
797- $ items = [];
798- $ sealed = true ;
799-
800- $ comments = [];
801-
802- do {
803- while (1 ) {
804- if ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL )) {
805- continue ;
806- } elseif ($ tokens ->currentTokenType () === Lexer::TOKEN_COMMENT ) {
807- $ comments [] = new Ast \Comment ($ tokens ->currentTokenValue (), $ tokens ->currentTokenLine (), $ tokens ->currentTokenIndex ());
808- $ tokens ->next ();
809- } else {
810- break ;
811- }
812- }
813-
814- if ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_CLOSE_CURLY_BRACKET )) {
815- return new Ast \Type \ArrayShapeNode ($ items , true , $ kind );
816- }
817-
818- if ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_VARIADIC )) {
819- $ sealed = false ;
820- $ tokens ->tryConsumeTokenType (Lexer::TOKEN_COMMA );
821- break ;
822- }
823-
824- $ startIndex = $ tokens ->currentTokenIndex ();
825- $ startLine = $ tokens ->currentTokenLine ();
826- $ items [] = $ this ->enrichWithAttributes (
827- $ tokens ,
828- $ this ->parseArrayShapeItem ($ tokens ),
829- $ startLine ,
830- $ startIndex ,
831- $ comments
832- );
833-
834- $ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL );
835- } while ($ tokens ->tryConsumeTokenType (Lexer::TOKEN_COMMA ));
836-
837- $ tokens ->tryConsumeTokenType (Lexer::TOKEN_PHPDOC_EOL );
838- $ tokens ->consumeTokenType (Lexer::TOKEN_CLOSE_CURLY_BRACKET );
839-
840- return new Ast \Type \ArrayShapeNode ($ items , $ sealed , $ kind );
841- }
842-
843-
844788 /** @phpstan-impure */
845789 private function parseArrayShapeItem (TokenIterator $ tokens ): Ast \Type \ArrayShapeItemNode
846790 {
0 commit comments