From ff8bf0ab822bce0cdcab1c3e1f965bfefbacec15 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Fri, 14 Feb 2020 10:45:35 +0100 Subject: [PATCH] Clarify code Co-Authored-By: Guilliam Xavier --- src/Composer/Command/ValidateCommand.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Composer/Command/ValidateCommand.php b/src/Composer/Command/ValidateCommand.php index 860974145..673c609c2 100644 --- a/src/Composer/Command/ValidateCommand.php +++ b/src/Composer/Command/ValidateCommand.php @@ -148,25 +148,25 @@ EOT } // Avoid setting the exit code to 1 in case --strict and --no-check-publish/--no-check-lock are combined - $allWarnings = $warnings; + $extraWarnings = []; // If checking publish errors, display them as errors, otherwise just show them as warnings if ($checkPublish) { $errors = array_merge($errors, $publishErrors); } else { - $allWarnings = array_merge($allWarnings, $publishErrors); + $extraWarnings = array_merge($extraWarnings, $publishErrors); } // If checking lock errors, display them as errors, otherwise just show them as warnings if ($checkLock) { $errors = array_merge($errors, $lockErrors); } else { - $allWarnings = array_merge($allWarnings, $lockErrors); + $extraWarnings = array_merge($extraWarnings, $lockErrors); } $messages = array( 'error' => $errors, - 'warning' => $allWarnings, + 'warning' => array_merge($warnings, $extraWarnings), ); foreach ($messages as $style => $msgs) {