@@ -82,7 +82,6 @@ public function printTable(OutputInterface $output, array $patchList)
82
82
$ table = $ this ->tableFactory ->create ($ output );
83
83
$ table ->setHeaders ([self ::ID , self ::TITLE , self ::TYPE , self ::STATUS , self ::DETAILS ]);
84
84
$ table ->setStyle ('box-double ' );
85
- $ table ->setColumnMaxWidth (1 , 50 );
86
85
87
86
$ rows = [];
88
87
foreach ($ patchList as $ patch ) {
@@ -181,23 +180,32 @@ public function printQuestion(InputInterface $input, OutputInterface $output, st
181
180
*/
182
181
private function createRow (AggregatedPatchInterface $ patch ): array
183
182
{
184
- $ glue = PHP_EOL . ' - ' ;
185
183
$ details = '' ;
186
184
if ($ patch ->getReplacedWith ()) {
187
- $ details .= '<info>Recommended replacement: ' . $ patch ->getReplacedWith () . PHP_EOL . '</info> ' ;
185
+ $ details .= '<info>Recommended replacement: ' . $ patch ->getReplacedWith () . '</info> ' . PHP_EOL ;
188
186
}
187
+
189
188
if ($ patch ->getRequire ()) {
190
- $ details .= 'Required patches: ' .
191
- '<comment> ' . $ glue . implode ($ glue , $ patch ->getRequire ()) . PHP_EOL . '</comment> ' ;
189
+ $ wrappedRequire = array_map (
190
+ function ($ item ) {
191
+ return sprintf ('<comment> - %s</comment> ' , $ item );
192
+ },
193
+ $ patch ->getRequire ()
194
+ );
195
+ $ details .= 'Required patches: ' . PHP_EOL . implode (PHP_EOL , $ wrappedRequire ) . PHP_EOL ;
192
196
}
197
+
193
198
if ($ patch ->getAffectedComponents ()) {
199
+ $ glue = PHP_EOL . ' - ' ;
194
200
$ details .= 'Affected components: ' . $ glue . implode ($ glue , $ patch ->getAffectedComponents ());
195
201
}
202
+
196
203
$ id = $ patch ->getType () === PatchInterface::TYPE_CUSTOM ? 'N/A ' : $ patch ->getId ();
204
+ $ title = chunk_split ($ patch ->getTitle (), 60 , PHP_EOL );
197
205
198
206
return [
199
207
self ::ID => '<comment> ' . $ id . '</comment> ' ,
200
- self ::TITLE => $ patch -> getTitle () ,
208
+ self ::TITLE => $ title ,
201
209
self ::TYPE => $ patch ->isDeprecated () ? '<error>DEPRECATED</error> ' : $ patch ->getType (),
202
210
self ::STATUS => $ this ->statusPool ->get ($ patch ->getId ()),
203
211
self ::DETAILS => $ details
0 commit comments