diff --git a/src/Composer/Package/MemoryPackage.php b/src/Composer/Package/MemoryPackage.php index b45e36ee8..e326210b2 100644 --- a/src/Composer/Package/MemoryPackage.php +++ b/src/Composer/Package/MemoryPackage.php @@ -19,6 +19,9 @@ namespace Composer\Package; */ class MemoryPackage extends BasePackage { + protected $type; + protected $repositoryType; + protected $repositoryUrl; protected $releaseType; protected $version; @@ -45,6 +48,54 @@ class MemoryPackage extends BasePackage $this->version = $version; } + /** + * @param string $type + */ + public function setType($type) + { + $this->type = $type; + } + + /** + * {@inheritDoc} + */ + public function getType() + { + return $this->type ?: 'library'; + } + + /** + * @param string $type + */ + public function setRepositoryType($type) + { + $this->repositoryType = $type; + } + + /** + * {@inheritDoc} + */ + public function getRepositoryType() + { + return $this->repositoryType; + } + + /** + * @param string $url + */ + public function setRepositoryUrl($url) + { + $this->repositoryUrl = $url; + } + + /** + * {@inheritDoc} + */ + public function getRepositoryUrl() + { + return $this->repositoryUrl; + } + /** * Set the release type * diff --git a/src/Composer/Package/PackageInterface.php b/src/Composer/Package/PackageInterface.php index 294fea6d0..e01e1918d 100644 --- a/src/Composer/Package/PackageInterface.php +++ b/src/Composer/Package/PackageInterface.php @@ -4,6 +4,7 @@ * This file is part of Composer. * * (c) Nils Adermann + * Jordi Boggiano * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. @@ -45,6 +46,27 @@ interface PackageInterface */ function matches($name, RelationConstraintInterface $constraint); + /** + * Returns the package type of this package, e.g. library + * + * @return string The package type + */ + function getType(); + + /** + * Returns the repository type of this package, e.g. git, svn, tar + * + * @return string The repository type + */ + function getRepositoryType(); + + /** + * Returns the repository url of this package, e.g. git://github.com/naderman/composer.git + * + * @return string The repository url + */ + function getRepositoryUrl(); + /** * Returns the release type of this package, e.g. stable or beta *