From 2eb0af264b5e18d2cc064aec7ce0e887b6cc82b4 Mon Sep 17 00:00:00 2001 From: Bryan Davis Date: Mon, 26 Oct 2015 20:33:36 -0600 Subject: [PATCH] Allow RootAliasPackage to override cached values AliasPackage caches the values of 'requires', 'devRequires', 'conflicts', 'provides', 'replaces' locally to allow `self.version` references to be properly updated to reference the alias. Plugins like composer-merge-plugin that manipulate these settings at runtime need to be able to change the values after alias construction. --- src/Composer/Package/RootAliasPackage.php | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Composer/Package/RootAliasPackage.php b/src/Composer/Package/RootAliasPackage.php index f9d056a59..9c723aa53 100644 --- a/src/Composer/Package/RootAliasPackage.php +++ b/src/Composer/Package/RootAliasPackage.php @@ -82,6 +82,33 @@ class RootAliasPackage extends AliasPackage implements RootPackageInterface $this->aliasOf->setDevRequires($devRequire); } + /** + * {@inheritDoc} + */ + public function setConflicts(array $conflicts) + { + $this->conflicts = $this->replaceSelfVersionDependencies($conflicts, 'conflicts'); + $this->aliasOf->setConflicts($conflicts); + } + + /** + * {@inheritDoc} + */ + public function setProvides(array $provides) + { + $this->provides = $this->replaceSelfVersionDependencies($provides, 'provides'); + $this->aliasOf->setProvides($provides); + } + + /** + * {@inheritDoc} + */ + public function setReplaces(array $replaces) + { + $this->replaces = $this->replaceSelfVersionDependencies($replaces, 'replaces'); + $this->aliasOf->setReplaces($replaces); + } + public function __clone() { parent::__clone();