Browse Source

* fluent interface for set methods
* strtolower() type so setting is a little more relaxed

till 13 năm trước cách đây
mục cha
commit
a8121bc0a6
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  1. 4 0
      src/Composer/Downloader/DownloadManager.php

+ 4 - 0
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);
         }