فهرست منبع

RootPackage::getScripts

Sven Wittevrongel 8 سال پیش
والد
کامیت
d0b0d1ad24

+ 8 - 0
src/Composer/Package/RootAliasPackage.php

@@ -70,6 +70,14 @@ class RootAliasPackage extends AliasPackage implements RootPackageInterface
         return $this->aliasOf->config;
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public function getScripts()
+    {
+        return $this->aliasOf->scripts;
+    }
+
     /**
      * {@inheritDoc}
      */

+ 19 - 0
src/Composer/Package/RootPackage.php

@@ -23,6 +23,7 @@ class RootPackage extends CompletePackage implements RootPackageInterface
     protected $preferStable = false;
     protected $stabilityFlags = array();
     protected $config = array();
+    protected $scripts = array();
     protected $references = array();
     protected $aliases = array();
 
@@ -98,6 +99,24 @@ class RootPackage extends CompletePackage implements RootPackageInterface
         return $this->config;
     }
 
+    /**
+     * Set the scripts
+     *
+     * @param array $scripts
+     */
+    public function setScripts($scripts)
+    {
+        $this->scripts = $scripts;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public function getScripts()
+    {
+        return $this->scripts;
+    }
+
     /**
      * Set the references
      *

+ 7 - 0
src/Composer/Package/RootPackageInterface.php

@@ -65,6 +65,13 @@ interface RootPackageInterface extends CompletePackageInterface
      */
     public function getConfig();
 
+    /**
+     * Returns the root package's scripts
+     *
+     * @return array
+     */
+    public function getScripts();
+
     /**
      * Set the required packages
      *