diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 36aff9e0..972c2c4d 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,20 +1,11 @@ - + - - $composerFile - $composerFile - $composerFile - $composerFile - $composerFile - $composerFile - $composerFile - $composerFile - $composerFile - $composerFile + + diff --git a/src/Command/NormalizeCommand.php b/src/Command/NormalizeCommand.php index 507abbd6..f216e6b6 100644 --- a/src/Command/NormalizeCommand.php +++ b/src/Command/NormalizeCommand.php @@ -14,6 +14,7 @@ namespace Ergebnis\Composer\Normalize\Command; use Composer\Command; +use Composer\Composer; use Composer\Console\Application; use Composer\Factory; use Composer\IO; @@ -132,7 +133,7 @@ protected function execute( $composerFile = $input->getArgument('file'); - if (null === $composerFile) { + if (!\is_string($composerFile)) { $composerFile = Factory::getComposerFile(); } @@ -141,6 +142,10 @@ protected function execute( $composerFile, ); + if (!$composer instanceof Composer) { + throw Exception\ShouldNotHappen::create(); + } + try { $indentFromExtra = self::indentFromExtra($composer->getPackage()->getExtra()); } catch (\RuntimeException $exception) {