Skip to content

Commit

Permalink
Fix: Verify that locker is an instance of Locker
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Nov 22, 2021
1 parent ce24f6b commit 72af70b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions composer-require-checker.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"Composer\\IO\\IOInterface",
"Composer\\Json\\JsonFile",
"Composer\\Json\\JsonValidationException",
"Composer\\Package\\Locker",
"Composer\\Plugin\\Capability\\CommandProvider",
"Composer\\Plugin\\Capable",
"Composer\\Plugin\\PluginInterface",
Expand Down
3 changes: 3 additions & 0 deletions src/Command/NormalizeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Composer\Console\Application;
use Composer\Factory;
use Composer\IO;
use Composer\Package;
use Ergebnis\Composer\Normalize\Exception;
use Ergebnis\Composer\Normalize\Version;
use Ergebnis\Json\Normalizer;
Expand Down Expand Up @@ -181,6 +182,7 @@ protected function execute(

if (
false === $input->getOption('no-check-lock')
&& $locker instanceof Package\Locker
&& $locker->isLocked()
&& !$locker->isFresh()
) {
Expand Down Expand Up @@ -279,6 +281,7 @@ protected function execute(

if (
true === $input->getOption('no-update-lock')
|| !$locker instanceof Package\Locker
|| false === $locker->isLocked()
) {
return 0;
Expand Down

0 comments on commit 72af70b

Please sign in to comment.