فهرست منبع

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.
Bryan Davis 9 سال پیش
والد
کامیت
2eb0af264b
1فایلهای تغییر یافته به همراه27 افزوده شده و 0 حذف شده
  1. 27 0
      src/Composer/Package/RootAliasPackage.php

+ 27 - 0
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();