From a1a7774374c46dd3e904035237e02cb20b37f0e5 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Tue, 24 Oct 2023 16:55:45 +0200 Subject: Use constants for SUCCESS/FAILURE and show errors even on quiet level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- core/Command/SetupChecks.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'core/Command') diff --git a/core/Command/SetupChecks.php b/core/Command/SetupChecks.php index d43b5a07592..f31acba63e3 100644 --- a/core/Command/SetupChecks.php +++ b/core/Command/SetupChecks.php @@ -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() : ''). - "" + ($description !== null ? ': '.$description : ''). + "", + $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; } } -- cgit v1.2.3