diff --git a/src/Composer/Command/ValidateCommand.php b/src/Composer/Command/ValidateCommand.php
index 99a74146b..aa37e978b 100644
--- a/src/Composer/Command/ValidateCommand.php
+++ b/src/Composer/Command/ValidateCommand.php
@@ -126,23 +126,25 @@ EOT
private function outputResult($io, $name, &$errors, &$warnings, $checkPublish = false, $publishErrors = array(), $checkLock = false, $lockErrors = array(), $printSchemaUrl = false, $isStrict = false)
{
+ $doPrintSchemaUrl = false;
+
if (!$errors && !$publishErrors && !$warnings) {
$io->write('' . $name . ' is valid');
} elseif (!$errors && !$publishErrors) {
$io->writeError('' . $name . ' is valid, but with a few warnings');
- if ($printSchemaUrl) {
- $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
- }
+ $doPrintSchemaUrl = $printSchemaUrl;
} elseif (!$errors) {
$io->writeError('' . $name . ' is valid for simple usage with composer but has');
$io->writeError('strict errors that make it unable to be published as a package:');
- if ($printSchemaUrl) {
- $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
- }
+ $doPrintSchemaUrl = $printSchemaUrl;
} else {
$io->writeError('' . $name . ' is invalid, the following errors/warnings were found:');
}
+ if ($doPrintSchemaUrl) {
+ $io->writeError('See https://getcomposer.org/doc/04-schema.md for details on the schema');
+ }
+
$allWarnings = $warnings;
// If checking publish errors, display them as errors, otherwise just show them as warnings