Browse Source

Use an alias to avoid duplicate class name issues.

The deprecated CookieCollection shares a name with this imported class
so we need an alias.
Mark Story 9 years ago
parent
commit
3c95282ec6
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/Http/Client/Response.php

+ 4 - 2
src/Http/Client/Response.php

@@ -13,7 +13,9 @@
  */
 namespace Cake\Http\Client;
 
-use Cake\Http\Cookie\CookieCollection;
+// This alias is necessary to avoid class name conflicts
+// with the deprecated class in this namespace.
+use Cake\Http\Cookie\CookieCollection as CookiesCollection;
 use Psr\Http\Message\ResponseInterface;
 use RuntimeException;
 use Zend\Diactoros\MessageTrait;
@@ -453,7 +455,7 @@ class Response extends Message implements ResponseInterface
         if ($this->cookies) {
             return;
         }
-        $this->cookies = CookieCollection::createFromHeader($this->getHeader('Set-Cookie'));
+        $this->cookies = CookiesCollection::createFromHeader($this->getHeader('Set-Cookie'));
     }
 
     /**