diff --git a/src/Factory/ClientFactory.php b/src/Factory/ClientFactory.php index f8d8dd1a..3c8b45c3 100644 --- a/src/Factory/ClientFactory.php +++ b/src/Factory/ClientFactory.php @@ -34,7 +34,6 @@ public function __construct($class) { $this->class = $class; $this->subscribers = []; - $this->clientOptions = []; } /** @@ -52,7 +51,7 @@ public function create(array $options = [], array $subscribers = []) if ($client instanceof HasEmitterInterface) { foreach ($this->subscribers as $name => $subscriber) { - if (!$subscribers || (isset($subscribers[$name]) && $subscribers[$name])) { + if (empty($subscribers) || (isset($subscribers[$name]) && $subscribers[$name])) { $client->getEmitter()->attach($subscriber); } } diff --git a/src/Factory/DescriptionFactory.php b/src/Factory/DescriptionFactory.php index 30a25ca4..90a104ff 100644 --- a/src/Factory/DescriptionFactory.php +++ b/src/Factory/DescriptionFactory.php @@ -48,7 +48,7 @@ public function getDescription($alias) */ public function loadDescriptions() { - if ($this->descriptions) { + if (!empty($this->descriptions)) { return; } diff --git a/src/GuzzleHttp/Subscriber/CacheSubscriber.php b/src/GuzzleHttp/Subscriber/CacheSubscriber.php index 9f4997c2..bd4c2ea7 100644 --- a/src/GuzzleHttp/Subscriber/CacheSubscriber.php +++ b/src/GuzzleHttp/Subscriber/CacheSubscriber.php @@ -57,6 +57,6 @@ public function onBefore(BeforeEvent $event) public function onComplete(CompleteEvent $event) { - $this->storage->save($event->getRequest(), $event->getResponse(), $event->getTransferInfo()); + $this->storage->save($event->getRequest(), $event->getResponse()); } } diff --git a/src/Tests/GuzzleHttp/Subscriber/CacheSubscriberTest.php b/src/Tests/GuzzleHttp/Subscriber/CacheSubscriberTest.php index 08232ae6..842518f5 100644 --- a/src/Tests/GuzzleHttp/Subscriber/CacheSubscriberTest.php +++ b/src/Tests/GuzzleHttp/Subscriber/CacheSubscriberTest.php @@ -36,8 +36,7 @@ public function testFetch() ->method('save') ->with( $this->isInstanceOf('GuzzleHttp\Message\RequestInterface'), - $this->equalTo($response), - $this->isType('array') + $this->equalTo($response) ) ; $adapter