From a8121bc0a60c9113704dfb8e99a8f1ea0a48ef20 Mon Sep 17 00:00:00 2001 From: till Date: Thu, 17 May 2012 20:07:49 +0200 Subject: [PATCH] * fluent interface for set methods * strtolower() type so setting is a little more relaxed --- src/Composer/Downloader/DownloadManager.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Composer/Downloader/DownloadManager.php b/src/Composer/Downloader/DownloadManager.php index e1441f182..e4392b85f 100644 --- a/src/Composer/Downloader/DownloadManager.php +++ b/src/Composer/Downloader/DownloadManager.php @@ -44,6 +44,7 @@ class DownloadManager public function setPreferSource($preferSource) { $this->preferSource = $preferSource; + return $this; } /** @@ -54,7 +55,9 @@ class DownloadManager */ public function setDownloader($type, DownloaderInterface $downloader) { + $type = strtolower($type); $this->downloaders[$type] = $downloader; + return $this; } /** @@ -68,6 +71,7 @@ class DownloadManager */ public function getDownloader($type) { + $type = strtolower($type); if (!isset($this->downloaders[$type])) { throw new \InvalidArgumentException('Unknown downloader type: '.$type); }