From b268e20d9fa9e9e4d058bc3ca7eff7ec5e5ff611 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 4 May 2021 16:43:24 +0200 Subject: [PATCH] Fix invalid interface usage --- src/Composer/Command/UpdateCommand.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Composer/Command/UpdateCommand.php b/src/Composer/Command/UpdateCommand.php index 7386b915a..c5ce5cb68 100644 --- a/src/Composer/Command/UpdateCommand.php +++ b/src/Composer/Command/UpdateCommand.php @@ -17,6 +17,7 @@ use Composer\DependencyResolver\Request; use Composer\Installer; use Composer\IO\IOInterface; use Composer\Package\Loader\RootPackageLoader; +use Composer\Package\RootPackage; use Composer\Plugin\CommandEvent; use Composer\Plugin\PluginEvents; use Composer\Package\Version\VersionParser; @@ -154,7 +155,9 @@ EOT } $rootPackage->setRequires($rootRequires); $rootPackage->setDevRequires($rootDevRequires); - $rootPackage->setReferences(RootPackageLoader::extractReferences($reqs, $rootPackage->getReferences())); + if ($rootPackage instanceof RootPackage) { + $rootPackage->setReferences(RootPackageLoader::extractReferences($reqs, $rootPackage->getReferences())); + } $rootPackage->setStabilityFlags(RootPackageLoader::extractStabilityFlags($reqs, $rootPackage->getMinimumStability(), $rootPackage->getStabilityFlags())); if ($input->getOption('interactive')) {