Skip to content

Fatal error on composer run - Call to undefined method Composer\Package\RootAliasPackage::setStabilityFlags #26

@astax-t

Description

@astax-t

I'm getting a fatal error when trying to run "composer update" or "composer install":

Fatal error: Call to undefined method Composer\Package\RootAliasPackage::setStabilityFlags() in ....web\vendor\wikimedia\composer-merge-plugin\src\MergePlugin.php on line 312

Looking at the code, the function mergeStabilityFlags takes RootPackageInterface as its argument, but this interface doesn't have method setStabilityFlags. It exists only in RootPackage, but not in RootAliasPackage (both implement RootPackageInterface).

I don't fully understand how this works in composer and when RootAliasPackage is used instead of RootPackage, so can't fix it properly. I can add if ($root instanceof RootPackage) in mergeStabilityFlags, but not sure if it's really correct fix.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions