1
0
Fork 0

Make package names and downloader/installer/repository types case insensitive

pull/13/head
Igor Wiedler 2011-09-14 16:01:54 +02:00
parent 900bed1c32
commit 9e8fc71870
3 changed files with 7 additions and 3 deletions

View File

@ -33,11 +33,13 @@ class Composer
public function addDownloader($type, $downloader)
{
$type = strtolower($type);
$this->downloaders[$type] = $downloader;
}
public function getDownloader($type)
{
$type = strtolower($type);
if (!isset($this->downloaders[$type])) {
throw new \UnexpectedValueException('Unknown source type: '.$type);
}
@ -46,11 +48,13 @@ class Composer
public function addInstaller($type, $installer)
{
$type = strtolower($type);
$this->installers[$type] = $installer;
}
public function getInstaller($type)
{
$type = strtolower($type);
if (!isset($this->installers[$type])) {
throw new \UnexpectedValueException('Unknown dependency type: '.$type);
}

View File

@ -34,7 +34,7 @@ abstract class BasePackage implements PackageInterface
*/
public function __construct($name)
{
$this->name = $name;
$this->name = strtolower($name);
$this->id = -1;
}

View File

@ -36,8 +36,8 @@ class Link
*/
public function __construct($source, $target, LinkConstraintInterface $constraint = null, $description = 'relates to')
{
$this->source = $source;
$this->target = $target;
$this->source = strtolower($source);
$this->target = strtolower($target);
$this->constraint = $constraint;
$this->description = $description;
}