installer: Use StatusValue::getMessages() instead of deprecated methods

Add a comment to better explain why both of these methods exist.

Change-Id: If280283b8f263bca347ee36209674d04d9cc5881
This commit is contained in:
Bartosz Dziewoński 2024-05-30 02:40:28 +02:00
parent 1a7f3571e7
commit f89c9bfba7
2 changed files with 12 additions and 10 deletions

View file

@ -289,13 +289,12 @@ class CliInstaller extends Installer {
}
public function showStatusMessage( Status $status ) {
$warnings = array_merge( $status->getWarningsArray(),
$status->getErrorsArray() );
if ( count( $warnings ) !== 0 ) {
foreach ( $warnings as $w ) {
$this->showMessage( ...$w );
}
// Show errors at the end in CLI installer to make them easier to notice
foreach ( $status->getMessages( 'warning' ) as $msg ) {
$this->showMessage( $msg );
}
foreach ( $status->getMessages( 'error' ) as $msg ) {
$this->showMessage( $msg );
}
}

View file

@ -686,9 +686,12 @@ class WebInstaller extends Installer {
}
public function showStatusMessage( Status $status ) {
$errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
foreach ( $errors as $error ) {
$this->showMessage( ...$error );
// Show errors at the top in web installer to make them easier to notice
foreach ( $status->getMessages( 'error' ) as $msg ) {
$this->showMessage( $msg );
}
foreach ( $status->getMessages( 'warning' ) as $msg ) {
$this->showMessage( $msg );
}
}