File tree Expand file tree Collapse file tree 2 files changed +36
-1
lines changed
Expand file tree Collapse file tree 2 files changed +36
-1
lines changed Original file line number Diff line number Diff line change 1010
1111$ routes = Cake \Routing \Router::routes ();
1212
13- $ amountOfRoutesPerGroup = [];
13+ $ amountOfRoutesPerGroup = $ duplicateRoutes = [];
1414foreach ($ routes as $ route ) {
15+ // Count the amount
1516 $ group = $ route ->defaults ['plugin ' ] ?? 'app ' ;
1617 if (!array_key_exists ($ group , $ amountOfRoutesPerGroup )) {
1718 $ amountOfRoutesPerGroup [$ group ] = 0 ;
1819 }
1920 $ amountOfRoutesPerGroup [$ group ]++;
21+
22+ if (!array_key_exists ($ route ->template , $ duplicateRoutes )) {
23+ $ duplicateRoutes [$ route ->template ] = 0 ;
24+ }
25+ $ duplicateRoutes [$ route ->template ]++;
2026}
2127
2228$ pluginNames = [];
7076 $ class .= ' highlighted ' ;
7177 }
7278
79+ // Mark duplicate routes
80+ if ($ duplicateRoutes [$ route ->template ] > 1 ) {
81+ $ class .= ' duplicate-route ' ;
82+ }
83+
7384 ?>
7485 <tr class="<?= $ class ?> ">
7586 <td><?= h (Hash::get ($ route ->options , '_name ' , $ route ->getName ())) ?> </td>
Original file line number Diff line number Diff line change 270270.debug-table td .left {
271271 text-align : left;
272272}
273+ .debug-table .duplicate-route td {
274+ background : # ffea96 ;
275+ }
273276.debug-table .highlighted td {
274277 background : # e7e9fd ;
275278}
@@ -625,3 +628,24 @@ pre,
625628 flex-wrap : wrap;
626629 margin : 0 -5px ;
627630}
631+
632+ .color-info-type {
633+ align-items : center;
634+ display : flex;
635+ }
636+
637+ .color-info-type : before {
638+ content : '' ;
639+ display : inline-block;
640+ height : 20px ;
641+ margin-right : 10px ;
642+ width : 20px ;
643+ }
644+
645+ .color-info-type--current-route : before {
646+ background : # e7e9fd ;
647+ }
648+
649+ .color-info-type--duplicate-route : before {
650+ background : # ffea96 ;
651+ }
You can’t perform that action at this time.
0 commit comments