File tree 2 files changed +13
-6
lines changed
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -587,12 +587,13 @@ private function buildError(array $blackMembersGroup): IdentifierRuleError
587
587
'transitive ' => false ,
588
588
];
589
589
590
+ $ tips = [];
591
+
590
592
foreach (array_slice ($ blackMembersGroup , 1 ) as $ transitivelyDeadMember ) {
591
593
$ transitiveDeadMemberRef = $ transitivelyDeadMember ->getMember ()->toHumanString ();
592
594
$ exclusionMessage = $ transitivelyDeadMember ->getExclusionMessage ();
593
595
594
- $ builder ->addTip ("Thus $ transitiveDeadMemberRef is transitively also unused {$ exclusionMessage }" );
595
-
596
+ $ tips [$ transitiveDeadMemberRef ] = "Thus $ transitiveDeadMemberRef is transitively also unused {$ exclusionMessage }" ;
596
597
$ metadata [$ transitiveDeadMemberRef ] = [
597
598
'file ' => $ transitivelyDeadMember ->getFile (),
598
599
'line ' => $ transitivelyDeadMember ->getLine (),
@@ -602,6 +603,12 @@ private function buildError(array $blackMembersGroup): IdentifierRuleError
602
603
603
604
$ builder ->metadata ($ metadata );
604
605
606
+ ksort ($ tips );
607
+
608
+ foreach ($ tips as $ tip ) {
609
+ $ builder ->addTip ($ tip );
610
+ }
611
+
605
612
return $ builder ->build ();
606
613
}
607
614
Original file line number Diff line number Diff line change @@ -242,16 +242,16 @@ public static function provideGroupingFiles(): iterable
242
242
[
243
243
'Unused Grouping\Example::boo ' ,
244
244
29 ,
245
+ "• Thus Grouping\Example::TRANSITIVELY_UNUSED_CONST is transitively also unused \n" .
245
246
"• Thus Grouping\Example::bag is transitively also unused \n" .
246
- "• Thus Grouping\Example::bar is transitively also unused \n" .
247
- '• Thus Grouping\Example::TRANSITIVELY_UNUSED_CONST is transitively also unused ' ,
247
+ '• Thus Grouping\Example::bar is transitively also unused ' ,
248
248
],
249
249
[
250
250
'Unused Grouping\Example::foo ' ,
251
251
23 ,
252
- "• Thus Grouping\Example::bar is transitively also unused \n" .
252
+ "• Thus Grouping\Example::TRANSITIVELY_UNUSED_CONST is transitively also unused \n" .
253
253
"• Thus Grouping\Example::bag is transitively also unused \n" .
254
- '• Thus Grouping\Example::TRANSITIVELY_UNUSED_CONST is transitively also unused ' ,
254
+ '• Thus Grouping\Example::bar is transitively also unused ' ,
255
255
],
256
256
[
257
257
'Unused Grouping\Example::recur ' ,
You can’t perform that action at this time.
0 commit comments