@@ -835,7 +835,7 @@ private function parseParameterFn() {
835835 $ parameter ->typeDeclarationList = $ this ->tryParseParameterTypeDeclarationList ($ parameter );
836836 if ($ parameter ->typeDeclarationList ) {
837837 $ children = $ parameter ->typeDeclarationList ->children ;
838- if (end ($ children ) instanceof MissingToken && ($ children [count ($ children ) - 2 ]->kind ?? null ) === TokenKind::AmpersandToken) {
838+ if (end ($ children ) instanceof MissingToken && ($ children [\ count ($ children ) - 2 ]->kind ?? null ) === TokenKind::AmpersandToken) {
839839 array_pop ($ parameter ->typeDeclarationList ->children );
840840 $ parameter ->byRefToken = array_pop ($ parameter ->typeDeclarationList ->children );
841841 if (!$ parameter ->typeDeclarationList ->children ) {
@@ -3140,14 +3140,27 @@ private function parseObjectCreationExpression($parentNode) {
31403140 return $ objectCreationExpression ;
31413141 }
31423142
3143+ /**
3144+ * @return DelimitedList\ArgumentExpressionList|null
3145+ */
31433146 private function parseArgumentExpressionList ($ parentNode ) {
3144- return $ this ->parseDelimitedList (
3147+ $ list = $ this ->parseDelimitedList (
31453148 DelimitedList \ArgumentExpressionList::class,
31463149 TokenKind::CommaToken,
31473150 $ this ->isArgumentExpressionStartFn (),
31483151 $ this ->parseArgumentExpressionFn (),
31493152 $ parentNode
31503153 );
3154+ $ children = $ list ->children ?? null ;
3155+ if (is_array ($ children ) && \count ($ children ) === 1 ) {
3156+ $ arg = $ children [0 ];
3157+ if ($ arg instanceof ArgumentExpression) {
3158+ if ($ arg ->dotDotDotToken && $ arg ->expression instanceof MissingToken && !$ arg ->colonToken && !$ arg ->name ) {
3159+ $ arg ->expression = null ;
3160+ }
3161+ }
3162+ }
3163+ return $ list ;
31513164 }
31523165
31533166 /**
0 commit comments