Minor cleanups, add license property to the PackageInterface

main
Jordi Boggiano 13 years ago
parent 8ab98a8b5d
commit f0e709ad09

@ -22,7 +22,6 @@ use Composer\DependencyResolver\RelationConstraint\RelationConstraintInterface;
abstract class BasePackage implements PackageInterface
{
protected $name;
protected $id;
/**
* All descendents' constructors should call this parent constructor
@ -32,7 +31,6 @@ abstract class BasePackage implements PackageInterface
public function __construct($name)
{
$this->name = $name;
}
/**

@ -24,6 +24,7 @@ class MemoryPackage extends BasePackage
protected $repositoryUrl;
protected $releaseType;
protected $version;
protected $license;
protected $requires = array();
protected $conflicts = array();
@ -37,12 +38,11 @@ class MemoryPackage extends BasePackage
*
* @param string $name The package's name
* @param string $version The package's version
* @param string $releaseType The package's release type (beta/rc/stable)
* @param int $id A positive unique id, zero to auto generate
* @param string $releaseType The package's release type (beta/rc/stable/dev)
*/
public function __construct($name, $version, $releaseType = 'stable', $id = 0)
public function __construct($name, $version, $releaseType = 'stable')
{
parent::__construct($name, $id);
parent::__construct($name);
$this->releaseType = $releaseType;
$this->version = $version;
@ -132,6 +132,24 @@ class MemoryPackage extends BasePackage
return $this->version;
}
/**
* Set the license
*
* @param string $license
*/
public function setLicense($license)
{
$this->license = $license;
}
/**
* {@inheritDoc}
*/
public function getLicense()
{
return $this->license;
}
/**
* Set the required packages
*

@ -47,7 +47,7 @@ interface PackageInterface
function matches($name, RelationConstraintInterface $constraint);
/**
* Returns the package type of this package, e.g. library
* Returns the package type, e.g. library
*
* @return string The package type
*/
@ -81,6 +81,13 @@ interface PackageInterface
*/
function getVersion();
/**
* Returns the package license, e.g. MIT, BSD, GPL
*
* @return string The package license
*/
function getLicense();
/**
* Returns a set of relations to packages which need to be installed before
* this package can be installed

Loading…
Cancel
Save