Skip to content

Commit

Permalink
Show message in the self command when there aren't unsupported modules
Browse files Browse the repository at this point in the history
  • Loading branch information
omarlopesino committed May 16, 2023
1 parent 5747bc2 commit 0e545c8
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/UpdaterCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -520,17 +520,22 @@ protected function showObsoleteDrupalModules() {
return array_values($unsupported_module);
}, $unsupported_modules_list));

$unsupported_modules_list_table_rows = [];
foreach ($unsupported_modules_list as $unsupported_module_info) {
$unsupported_modules_list_table_rows[] = $unsupported_module_info;
$unsupported_modules_list_table_rows[] = new TableSeparator();
}
$fixed_drupal_advisories_table = new Table($this->output);
$fixed_drupal_advisories_table->setHeaders(['Module', 'Current version', 'Recommended version', 'Environment(s)']);
if (!empty($unsupported_modules_list)) {
$unsupported_modules_list_table_rows = [];
foreach ($unsupported_modules_list as $unsupported_module_info) {
$unsupported_modules_list_table_rows[] = $unsupported_module_info;
$unsupported_modules_list_table_rows[] = new TableSeparator();
}
$fixed_drupal_advisories_table = new Table($this->output);
$fixed_drupal_advisories_table->setHeaders(['Module', 'Current version', 'Recommended version', 'Environment(s)']);

array_pop($unsupported_modules_list_table_rows);
$fixed_drupal_advisories_table->setRows($unsupported_modules_list_table_rows);
$fixed_drupal_advisories_table->render();
array_pop($unsupported_modules_list_table_rows);
$fixed_drupal_advisories_table->setRows($unsupported_modules_list_table_rows);
$fixed_drupal_advisories_table->render();
}
else {
$this->output->writeln('This project does not contain obsolete modules.');
}

}

Expand Down

0 comments on commit 0e545c8

Please sign in to comment.