Use constants for SUCCESS/FAILURE and show errors even on quiet level

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2023-10-24 16:55:45 +02:00 committed by Côme Chilliet
parent b5eeaa90d7
commit a1a7774374

View file

@ -66,12 +66,15 @@ class SetupChecks extends Base {
'error' => '❌',
default => '',
};
$verbosity = ($check->getSeverity() === 'error' ? OutputInterface::VERBOSITY_QUIET : OutputInterface::VERBOSITY_NORMAL);
$description = $check->getDescription();
$output->writeln(
"\t\t<{$styleTag}>".
"{$emoji} ".
$title.
($check->getDescription() !== null ? ': '.$check->getDescription() : '').
"</{$styleTag}>"
($description !== null ? ': '.$description : '').
"</{$styleTag}>",
$verbosity
);
}
}
@ -79,10 +82,10 @@ class SetupChecks extends Base {
foreach ($results as $category => $checks) {
foreach ($checks as $title => $check) {
if ($check->getSeverity() !== 'success') {
return 1;
return self::FAILURE;
}
}
}
return 0;
return self::SUCCESS;
}
}