Merge remote-tracking branch 'ktomk/patch-validate-no-check-lock' into 2.2
commit
d64e32c991
|
@ -2365,6 +2365,11 @@ parameters:
|
||||||
count: 2
|
count: 2
|
||||||
path: ../src/Composer/Command/ValidateCommand.php
|
path: ../src/Composer/Command/ValidateCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in &&, mixed given on the right side\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../src/Composer/Command/ValidateCommand.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Only booleans are allowed in a negated boolean, array\\<Composer\\\\Package\\\\BasePackage\\> given\\.$#"
|
message: "#^Only booleans are allowed in a negated boolean, array\\<Composer\\\\Package\\\\BasePackage\\> given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
@ -2400,6 +2405,11 @@ parameters:
|
||||||
count: 1
|
count: 1
|
||||||
path: ../src/Composer/Command/ValidateCommand.php
|
path: ../src/Composer/Command/ValidateCommand.php
|
||||||
|
|
||||||
|
-
|
||||||
|
message: "#^Only booleans are allowed in \\|\\|, mixed given on the right side\\.$#"
|
||||||
|
count: 1
|
||||||
|
path: ../src/Composer/Command/ValidateCommand.php
|
||||||
|
|
||||||
-
|
-
|
||||||
message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{Composer\\\\Package\\\\RootPackageInterface, 'getDevRequires'\\|'getRequires'\\} given\\.$#"
|
message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{Composer\\\\Package\\\\RootPackageInterface, 'getDevRequires'\\|'getRequires'\\} given\\.$#"
|
||||||
count: 1
|
count: 1
|
||||||
|
|
|
@ -45,6 +45,7 @@ class ValidateCommand extends BaseCommand
|
||||||
->setDescription('Validates a composer.json and composer.lock.')
|
->setDescription('Validates a composer.json and composer.lock.')
|
||||||
->setDefinition(array(
|
->setDefinition(array(
|
||||||
new InputOption('no-check-all', null, InputOption::VALUE_NONE, 'Do not validate requires for overly strict/loose constraints'),
|
new InputOption('no-check-all', null, InputOption::VALUE_NONE, 'Do not validate requires for overly strict/loose constraints'),
|
||||||
|
new InputOption('check-lock', null, InputOption::VALUE_NONE, 'Check if lock file is up to date (even config.lock is false, overrides --no-check-lock)'),
|
||||||
new InputOption('no-check-lock', null, InputOption::VALUE_NONE, 'Do not check if lock file is up to date'),
|
new InputOption('no-check-lock', null, InputOption::VALUE_NONE, 'Do not check if lock file is up to date'),
|
||||||
new InputOption('no-check-publish', null, InputOption::VALUE_NONE, 'Do not check for publish errors'),
|
new InputOption('no-check-publish', null, InputOption::VALUE_NONE, 'Do not check for publish errors'),
|
||||||
new InputOption('no-check-version', null, InputOption::VALUE_NONE, 'Do not report a warning if the version field is present'),
|
new InputOption('no-check-version', null, InputOption::VALUE_NONE, 'Do not report a warning if the version field is present'),
|
||||||
|
@ -95,6 +96,8 @@ EOT
|
||||||
|
|
||||||
$lockErrors = array();
|
$lockErrors = array();
|
||||||
$composer = Factory::create($io, $file, $input->hasParameterOption('--no-plugins'));
|
$composer = Factory::create($io, $file, $input->hasParameterOption('--no-plugins'));
|
||||||
|
// config.lock = false ~= implicit --no-check-lock; --check-lock overrides
|
||||||
|
$checkLock = ($checkLock && $composer->getConfig()->get('lock')) || $input->getOption('check-lock');
|
||||||
$locker = $composer->getLocker();
|
$locker = $composer->getLocker();
|
||||||
if ($locker->isLocked() && !$locker->isFresh()) {
|
if ($locker->isLocked() && !$locker->isFresh()) {
|
||||||
$lockErrors[] = '- The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update` or `composer update <package name>`.';
|
$lockErrors[] = '- The lock file is not up to date with the latest changes in composer.json, it is recommended that you run `composer update` or `composer update <package name>`.';
|
||||||
|
|
Loading…
Reference in New Issue