1
0
Fork 0

Add type/repositoryType and repositoryUrl package properties

pull/1/head
Jordi Boggiano 2011-04-17 21:48:20 +02:00
parent 1d5f5885bc
commit bb5e59e30f
2 changed files with 73 additions and 0 deletions

View File

@ -19,6 +19,9 @@ namespace Composer\Package;
*/ */
class MemoryPackage extends BasePackage class MemoryPackage extends BasePackage
{ {
protected $type;
protected $repositoryType;
protected $repositoryUrl;
protected $releaseType; protected $releaseType;
protected $version; protected $version;
@ -45,6 +48,54 @@ class MemoryPackage extends BasePackage
$this->version = $version; $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 * Set the release type
* *

View File

@ -4,6 +4,7 @@
* This file is part of Composer. * This file is part of Composer.
* *
* (c) Nils Adermann <naderman@naderman.de> * (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
* *
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
@ -45,6 +46,27 @@ interface PackageInterface
*/ */
function matches($name, RelationConstraintInterface $constraint); 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 * Returns the release type of this package, e.g. stable or beta
* *