9
9
10
10
use Magento \CloudPatches \Console \ConfirmationQuestionFactory ;
11
11
use Magento \CloudPatches \Console \TableFactory ;
12
+ use Magento \CloudPatches \Patch \Collector \CommunityCollector ;
12
13
use Magento \CloudPatches \Patch \Data \AggregatedPatchInterface ;
13
14
use Magento \CloudPatches \Patch \Data \PatchInterface ;
14
15
use Magento \CloudPatches \Patch \Status \StatusPool ;
@@ -26,6 +27,10 @@ class Renderer
26
27
27
28
const TITLE = 'Title ' ;
28
29
30
+ const CATEGORY = 'Category ' ;
31
+
32
+ const ORIGIN = 'Origin ' ;
33
+
29
34
const TYPE = 'Type ' ;
30
35
31
36
const STATUS = 'Status ' ;
@@ -80,7 +85,7 @@ public function __construct(
80
85
public function printTable (OutputInterface $ output , array $ patchList )
81
86
{
82
87
$ 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 ]);
84
89
$ table ->setStyle ('box-double ' );
85
90
86
91
$ rows = [];
@@ -89,6 +94,9 @@ public function printTable(OutputInterface $output, array $patchList)
89
94
}
90
95
91
96
usort ($ rows , function ($ a , $ b ) {
97
+ if ($ a [self ::STATUS ] === $ b [self ::STATUS ]) {
98
+ return strcmp ($ a [self ::ORIGIN ], $ b [self ::ORIGIN ]);
99
+ }
92
100
return strcmp ($ a [self ::STATUS ], $ b [self ::STATUS ]);
93
101
});
94
102
@@ -165,7 +173,10 @@ public function printQuestion(InputInterface $input, OutputInterface $output, st
165
173
*/
166
174
private function createRow (AggregatedPatchInterface $ patch ): array
167
175
{
168
- $ details = '' ;
176
+ $ details = 'Patch type: '
177
+ . ($ patch ->isDeprecated () ? '<error>DEPRECATED</error> ' : $ patch ->getType ())
178
+ . PHP_EOL ;
179
+
169
180
if ($ patch ->getReplacedWith ()) {
170
181
$ details .= '<info>Recommended replacement: ' . $ patch ->getReplacedWith () . '</info> ' . PHP_EOL ;
171
182
}
@@ -191,7 +202,8 @@ function ($item) {
191
202
return [
192
203
self ::ID => '<comment> ' . $ id . '</comment> ' ,
193
204
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 (),
195
207
self ::STATUS => $ this ->statusPool ->get ($ patch ->getId ()),
196
208
self ::DETAILS => $ details
197
209
];
0 commit comments