ValidateCommand: factorize $printSchemaUrl code
parent
b5e41d6792
commit
901d177179
|
@ -126,23 +126,25 @@ EOT
|
||||||
|
|
||||||
private function outputResult($io, $name, &$errors, &$warnings, $checkPublish = false, $publishErrors = array(), $checkLock = false, $lockErrors = array(), $printSchemaUrl = false, $isStrict = false)
|
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) {
|
if (!$errors && !$publishErrors && !$warnings) {
|
||||||
$io->write('<info>' . $name . ' is valid</info>');
|
$io->write('<info>' . $name . ' is valid</info>');
|
||||||
} elseif (!$errors && !$publishErrors) {
|
} elseif (!$errors && !$publishErrors) {
|
||||||
$io->writeError('<info>' . $name . ' is valid, but with a few warnings</info>');
|
$io->writeError('<info>' . $name . ' is valid, but with a few warnings</info>');
|
||||||
if ($printSchemaUrl) {
|
$doPrintSchemaUrl = $printSchemaUrl;
|
||||||
$io->writeError('<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>');
|
|
||||||
}
|
|
||||||
} elseif (!$errors) {
|
} elseif (!$errors) {
|
||||||
$io->writeError('<info>' . $name . ' is valid for simple usage with composer but has</info>');
|
$io->writeError('<info>' . $name . ' is valid for simple usage with composer but has</info>');
|
||||||
$io->writeError('<info>strict errors that make it unable to be published as a package:</info>');
|
$io->writeError('<info>strict errors that make it unable to be published as a package:</info>');
|
||||||
if ($printSchemaUrl) {
|
$doPrintSchemaUrl = $printSchemaUrl;
|
||||||
$io->writeError('<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>');
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$io->writeError('<error>' . $name . ' is invalid, the following errors/warnings were found:</error>');
|
$io->writeError('<error>' . $name . ' is invalid, the following errors/warnings were found:</error>');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($doPrintSchemaUrl) {
|
||||||
|
$io->writeError('<warning>See https://getcomposer.org/doc/04-schema.md for details on the schema</warning>');
|
||||||
|
}
|
||||||
|
|
||||||
$allWarnings = $warnings;
|
$allWarnings = $warnings;
|
||||||
|
|
||||||
// If checking publish errors, display them as errors, otherwise just show them as warnings
|
// If checking publish errors, display them as errors, otherwise just show them as warnings
|
||||||
|
|
Loading…
Reference in New Issue