Skip to content
This repository has been archived by the owner on Jul 15, 2021. It is now read-only.

Commit

Permalink
Fixed issue with request transfer info being injected for no reason
Browse files Browse the repository at this point in the history
  • Loading branch information
csarrazi committed Jun 5, 2015
1 parent 95c681a commit 7e29eb5
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/Factory/ClientFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function __construct($class)
{
$this->class = $class;
$this->subscribers = [];
$this->clientOptions = [];
}

/**
Expand All @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Factory/DescriptionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function getDescription($alias)
*/
public function loadDescriptions()
{
if ($this->descriptions) {
if (!empty($this->descriptions)) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion src/GuzzleHttp/Subscriber/CacheSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
3 changes: 1 addition & 2 deletions src/Tests/GuzzleHttp/Subscriber/CacheSubscriberTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7e29eb5

Please sign in to comment.