1
0
Fork 0

* fluent interface for set methods

* strtolower() type so setting is a little more relaxed
pull/710/head
till 2012-05-17 20:07:49 +02:00
parent 30cfb69739
commit a8121bc0a6
1 changed files with 4 additions and 0 deletions

View File

@ -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);
}