Skip to content

Commit

Permalink
Merge pull request php-http#17 from php-http/analysis-qyAGNq
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
sagikazarmark committed Dec 15, 2015
2 parents 98b61e0 + 525b029 commit 4c33676
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Guzzle6HttpAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use GuzzleHttp\ClientInterface;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Http\Client\Promise;
use Http\Client\Tools\HttpClientEmulator;
use Psr\Http\Message\RequestInterface;

Expand Down
8 changes: 4 additions & 4 deletions src/Guzzle6Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,25 +48,25 @@ class Guzzle6Promise implements Promise
public function __construct(PromiseInterface $promise, RequestInterface $request)
{
$this->request = $request;
$this->state = self::PENDING;
$this->state = self::PENDING;
$this->promise = $promise->then(function ($response) {
$this->response = $response;
$this->state = self::FULFILLED;

return $response;
}, function ($reason) use ($request) {
if ($reason instanceof HttplugException) {
$this->state = self::REJECTED;
$this->state = self::REJECTED;
$this->exception = $reason;

throw $this->exception;
}

if (!($reason instanceof GuzzleExceptions\GuzzleException)) {
throw new \RuntimeException("Invalid reason");
throw new \RuntimeException('Invalid reason');
}

$this->state = self::REJECTED;
$this->state = self::REJECTED;
$this->exception = $this->handleException($reason, $request);

throw $this->exception;
Expand Down

0 comments on commit 4c33676

Please sign in to comment.