From 72af70bb0640b5a66b8d109be21aaca323b6e9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Mon, 22 Nov 2021 11:16:02 +0100 Subject: [PATCH] Fix: Verify that locker is an instance of Locker --- composer-require-checker.json | 1 + src/Command/NormalizeCommand.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/composer-require-checker.json b/composer-require-checker.json index a11ecf3b..b1208fb7 100644 --- a/composer-require-checker.json +++ b/composer-require-checker.json @@ -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", diff --git a/src/Command/NormalizeCommand.php b/src/Command/NormalizeCommand.php index 6ef4e618..57bdbfbe 100644 --- a/src/Command/NormalizeCommand.php +++ b/src/Command/NormalizeCommand.php @@ -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; @@ -181,6 +182,7 @@ protected function execute( if ( false === $input->getOption('no-check-lock') + && $locker instanceof Package\Locker && $locker->isLocked() && !$locker->isFresh() ) { @@ -279,6 +281,7 @@ protected function execute( if ( true === $input->getOption('no-update-lock') + || !$locker instanceof Package\Locker || false === $locker->isLocked() ) { return 0;