File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -1118,6 +1118,39 @@ public function enterNode(Node $node)
11181118 $ addItemsWithCommentsToObjectShape ,
11191119 ];
11201120
1121+ $ removeComment = new class extends AbstractNodeVisitor {
1122+
1123+ public function enterNode (Node $ node )
1124+ {
1125+ $ comments = $ node ->getAttribute (Attribute::COMMENTS );
1126+ if ($ comments === null || $ comments === []) {
1127+ return null ;
1128+ }
1129+
1130+ $ node ->setAttribute (Attribute::COMMENTS , []);
1131+
1132+ return $ node ;
1133+ }
1134+
1135+ };
1136+
1137+ yield [
1138+ self ::nowdoc ('
1139+ /**
1140+ * @return array{
1141+ * // b comment
1142+ * b: int,
1143+ * }
1144+ */ ' ),
1145+ self ::nowdoc ('
1146+ /**
1147+ * @return array{
1148+ * b: int,
1149+ * }
1150+ */ ' ),
1151+ $ removeComment ,
1152+ ];
1153+
11211154 $ removeItemWithComment = new class extends AbstractNodeVisitor {
11221155
11231156 public function enterNode (Node $ node )
You can’t perform that action at this time.
0 commit comments