Skip to content

Commit

Permalink
implicit "--no-check-lock" (10715, --no-check-lock; 3/?)
Browse files Browse the repository at this point in the history
... squelch ... and there is no  InputOption::VALUE_NEGATABLE [1].

issue: 10715
[1]: https://symfony.com/blog/new-in-symfony-5-3-negatable-command-options
  • Loading branch information
ktomk committed Apr 12, 2022
1 parent 50c999b commit 983d680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Composer/Command/ValidateCommand.php
Expand Up @@ -96,8 +96,8 @@ protected function execute(InputInterface $input, OutputInterface $output)

$lockErrors = array();
$composer = Factory::create($io, $file, $input->hasParameterOption('--no-plugins'));
$checkLock = $checkLock && $composer->getConfig()->getBool('lock'); // config.lock = false ~= implicit --no-check-lock
$checkLock = $checkLock || (bool)$input->getOption('check-lock'); // --check-lock overrides
// config.lock = false ~= implicit --no-check-lock; --check-lock overrides
$checkLock = ($checkLock && $composer->getConfig()->getBool('lock')) || $input->getOption('check-lock');
$locker = $composer->getLocker();
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>`.';
Expand Down

0 comments on commit 983d680

Please sign in to comment.