File tree Expand file tree Collapse file tree 2 files changed +13
-6
lines changed
Expand file tree Collapse file tree 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
587587 'transitive ' => false ,
588588 ];
589589
590+ $ tips = [];
591+
590592 foreach (array_slice ($ blackMembersGroup , 1 ) as $ transitivelyDeadMember ) {
591593 $ transitiveDeadMemberRef = $ transitivelyDeadMember ->getMember ()->toHumanString ();
592594 $ exclusionMessage = $ transitivelyDeadMember ->getExclusionMessage ();
593595
594- $ builder ->addTip ("Thus $ transitiveDeadMemberRef is transitively also unused {$ exclusionMessage }" );
595-
596+ $ tips [$ transitiveDeadMemberRef ] = "Thus $ transitiveDeadMemberRef is transitively also unused {$ exclusionMessage }" ;
596597 $ metadata [$ transitiveDeadMemberRef ] = [
597598 'file ' => $ transitivelyDeadMember ->getFile (),
598599 'line ' => $ transitivelyDeadMember ->getLine (),
@@ -602,6 +603,12 @@ private function buildError(array $blackMembersGroup): IdentifierRuleError
602603
603604 $ builder ->metadata ($ metadata );
604605
606+ ksort ($ tips );
607+
608+ foreach ($ tips as $ tip ) {
609+ $ builder ->addTip ($ tip );
610+ }
611+
605612 return $ builder ->build ();
606613 }
607614
Original file line number Diff line number Diff line change @@ -242,16 +242,16 @@ public static function provideGroupingFiles(): iterable
242242 [
243243 'Unused Grouping\Example::boo ' ,
244244 29 ,
245+ "• Thus Grouping\Example::TRANSITIVELY_UNUSED_CONST is transitively also unused \n" .
245246 "• 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 ' ,
248248 ],
249249 [
250250 'Unused Grouping\Example::foo ' ,
251251 23 ,
252- "• Thus Grouping\Example::bar is transitively also unused \n" .
252+ "• Thus Grouping\Example::TRANSITIVELY_UNUSED_CONST is transitively also unused \n" .
253253 "• 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 ' ,
255255 ],
256256 [
257257 'Unused Grouping\Example::recur ' ,
You can’t perform that action at this time.
0 commit comments