diff --git a/src/Composer/Package/Loader/ArrayLoader.php b/src/Composer/Package/Loader/ArrayLoader.php index 3cc440a93..61c1170a0 100644 --- a/src/Composer/Package/Loader/ArrayLoader.php +++ b/src/Composer/Package/Loader/ArrayLoader.php @@ -73,6 +73,10 @@ class ArrayLoader $package->setExtra($config['extra']); } + if (!empty($config['description']) && is_string($config['description'])) { + $package->setDescription($config['description']); + } + if (!empty($config['keywords'])) { $package->setKeywords(is_array($config['keywords']) ? $config['keywords'] : array($config['keywords'])); } diff --git a/src/Composer/Package/MemoryPackage.php b/src/Composer/Package/MemoryPackage.php index 419688a43..8c4ec4d9b 100644 --- a/src/Composer/Package/MemoryPackage.php +++ b/src/Composer/Package/MemoryPackage.php @@ -36,6 +36,7 @@ class MemoryPackage extends BasePackage protected $releaseDate; protected $keywords; protected $authors; + protected $description; protected $extra = array(); protected $requires = array(); @@ -451,6 +452,24 @@ class MemoryPackage extends BasePackage return $this->authors; } + /** + * Set the description + * + * @param string $description + */ + public function setDescription($description) + { + $this->description = $description; + } + + /** + * {@inheritDoc} + */ + public function getDescription() + { + return $this->description; + } + /** * Set the autoload mapping * diff --git a/src/Composer/Package/PackageInterface.php b/src/Composer/Package/PackageInterface.php index f0bc3ae1d..afa0849d1 100644 --- a/src/Composer/Package/PackageInterface.php +++ b/src/Composer/Package/PackageInterface.php @@ -272,6 +272,13 @@ interface PackageInterface */ function getKeywords(); + /** + * Returns the package description + * + * @return string + */ + function getDescription(); + /** * Returns an array of authors of the package *