Skip to content

Commit 1113e58

Browse files
committed
MC-36033: Split ece-patches and magento-patches application
- fix table render for Symfony < 4
1 parent 6ddb1fe commit 1113e58

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/Command/Process/Renderer.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public function printTable(OutputInterface $output, array $patchList)
8282
$table = $this->tableFactory->create($output);
8383
$table->setHeaders([self::ID, self::TITLE, self::TYPE, self::STATUS, self::DETAILS]);
8484
$table->setStyle('box-double');
85-
$table->setColumnMaxWidth(1, 50);
8685

8786
$rows = [];
8887
foreach ($patchList as $patch) {
@@ -181,23 +180,32 @@ public function printQuestion(InputInterface $input, OutputInterface $output, st
181180
*/
182181
private function createRow(AggregatedPatchInterface $patch): array
183182
{
184-
$glue = PHP_EOL . ' - ';
185183
$details = '';
186184
if ($patch->getReplacedWith()) {
187-
$details .= '<info>Recommended replacement: ' . $patch->getReplacedWith() . PHP_EOL . '</info>';
185+
$details .= '<info>Recommended replacement: ' . $patch->getReplacedWith() . '</info>' . PHP_EOL;
188186
}
187+
189188
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;
192196
}
197+
193198
if ($patch->getAffectedComponents()) {
199+
$glue = PHP_EOL . ' - ';
194200
$details .= 'Affected components:' . $glue . implode($glue, $patch->getAffectedComponents());
195201
}
202+
196203
$id = $patch->getType() === PatchInterface::TYPE_CUSTOM ? 'N/A' : $patch->getId();
204+
$title = chunk_split($patch->getTitle(), 60, PHP_EOL);
197205

198206
return [
199207
self::ID => '<comment>' . $id . '</comment>',
200-
self::TITLE => $patch->getTitle(),
208+
self::TITLE => $title,
201209
self::TYPE => $patch->isDeprecated() ? '<error>DEPRECATED</error>' : $patch->getType(),
202210
self::STATUS => $this->statusPool->get($patch->getId()),
203211
self::DETAILS => $details

0 commit comments

Comments
 (0)