Skip to content

Commit

Permalink
implicit "--no-check-lock" (10715, --no-check-lock; 1/3)
Browse files Browse the repository at this point in the history
- `{"config": {"lock": false}}` is an implicit `--no-check-lock`

issue: 10715
  • Loading branch information
ktomk committed Apr 12, 2022
1 parent 9bfd059 commit dc84f03
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions phpstan/baseline.neon
Expand Up @@ -2375,6 +2375,11 @@ parameters:
count: 2
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\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions src/Composer/Command/ValidateCommand.php
Expand Up @@ -95,6 +95,7 @@ protected function execute(InputInterface $input, OutputInterface $output)

$lockErrors = array();
$composer = Factory::create($io, $file, $input->hasParameterOption('--no-plugins'));
$checkLock = $checkLock && $composer->getConfig()->get('lock'); // config.lock = false ~= implicit --no-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 dc84f03

Please sign in to comment.