99
1010use Magento \CloudPatches \Console \ConfirmationQuestionFactory ;
1111use Magento \CloudPatches \Console \TableFactory ;
12+ use Magento \CloudPatches \Patch \Collector \CommunityCollector ;
1213use Magento \CloudPatches \Patch \Data \AggregatedPatchInterface ;
1314use Magento \CloudPatches \Patch \Data \PatchInterface ;
1415use Magento \CloudPatches \Patch \Status \StatusPool ;
@@ -26,6 +27,10 @@ class Renderer
2627
2728 const TITLE = 'Title ' ;
2829
30+ const CATEGORY = 'Category ' ;
31+
32+ const ORIGIN = 'Origin ' ;
33+
2934 const TYPE = 'Type ' ;
3035
3136 const STATUS = 'Status ' ;
@@ -80,7 +85,7 @@ public function __construct(
8085 public function printTable (OutputInterface $ output , array $ patchList )
8186 {
8287 $ table = $ this ->tableFactory ->create ($ output );
83- $ table ->setHeaders ([self ::ID , self ::TITLE , self ::TYPE , self ::STATUS , self ::DETAILS ]);
88+ $ table ->setHeaders ([self ::ID , self ::TITLE , self ::CATEGORY , self :: ORIGIN , self ::STATUS , self ::DETAILS ]);
8489 $ table ->setStyle ('box-double ' );
8590
8691 $ rows = [];
@@ -89,6 +94,9 @@ public function printTable(OutputInterface $output, array $patchList)
8994 }
9095
9196 usort ($ rows , function ($ a , $ b ) {
97+ if ($ a [self ::STATUS ] === $ b [self ::STATUS ]) {
98+ return strcmp ($ a [self ::ORIGIN ], $ b [self ::ORIGIN ]);
99+ }
92100 return strcmp ($ a [self ::STATUS ], $ b [self ::STATUS ]);
93101 });
94102
@@ -165,7 +173,10 @@ public function printQuestion(InputInterface $input, OutputInterface $output, st
165173 */
166174 private function createRow (AggregatedPatchInterface $ patch ): array
167175 {
168- $ details = '' ;
176+ $ details = 'Patch type: '
177+ . ($ patch ->isDeprecated () ? '<error>DEPRECATED</error> ' : $ patch ->getType ())
178+ . PHP_EOL ;
179+
169180 if ($ patch ->getReplacedWith ()) {
170181 $ details .= '<info>Recommended replacement: ' . $ patch ->getReplacedWith () . '</info> ' . PHP_EOL ;
171182 }
@@ -191,7 +202,8 @@ function ($item) {
191202 return [
192203 self ::ID => '<comment> ' . $ id . '</comment> ' ,
193204 self ::TITLE => $ title ,
194- self ::TYPE => $ patch ->isDeprecated () ? '<error>DEPRECATED</error> ' : $ patch ->getType (),
205+ self ::CATEGORY => implode (PHP_EOL , $ patch ->getCategories ()),
206+ self ::ORIGIN => $ patch ->getOrigin (),
195207 self ::STATUS => $ this ->statusPool ->get ($ patch ->getId ()),
196208 self ::DETAILS => $ details
197209 ];
0 commit comments