Skip to content

Commit

Permalink
Merge pull request #46 from shulard/chore/fix-ci-builds
Browse files Browse the repository at this point in the history
Add missing configuration file for GitHub action builds.
  • Loading branch information
shulard authored Dec 17, 2020
2 parents 16e7abd + 1189d92 commit 7013b1b
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 23 deletions.
13 changes: 0 additions & 13 deletions .php_cs

This file was deleted.

14 changes: 14 additions & 0 deletions .php_cs.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

<?php

$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->in(__DIR__)
;

return PhpCsFixer\Config::create()
->setRules([
'@Symfony' => true,
'array_syntax' => ['syntax' => 'short'],
])
->setFinder($finder);
4 changes: 4 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
level: max
paths:
- src
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Http\Adapter\React;

use Http\Client\HttpClient;
use Http\Client\HttpAsyncClient;
use Http\Client\HttpClient;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseInterface;
use React\EventLoop\LoopInterface;
Expand Down
9 changes: 5 additions & 4 deletions src/Promise.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ final class Promise implements HttpPromise
/**
* PSR7 received response.
*
* @var ResponseInterface
* @var ResponseInterface|null
*/
private $response;

/**
* Execution error.
*
* @var Exception
* @var HttplugException
*/
private $exception;

Expand Down Expand Up @@ -69,7 +69,7 @@ public function __construct(PromiseInterface $promise, LoopInterface $loop, Requ
$this->request = $request;
$this->loop = $loop;
$this->promise = $promise->then(
function (?ResponseInterface $response): ResponseInterface {
function (?ResponseInterface $response): ?ResponseInterface {
$this->response = $response;
$this->state = self::FULFILLED;

Expand All @@ -92,7 +92,8 @@ function ($reason): void {
}

throw $this->exception;
});
}
);
}

public function then(?callable $onFulfilled = null, ?callable $onRejected = null)
Expand Down
6 changes: 3 additions & 3 deletions src/ReactFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Http\Adapter\React;

use React\EventLoop\LoopInterface;
use React\EventLoop\Factory as EventLoopFactory;
use React\EventLoop\LoopInterface;
use React\Http\Browser;
use React\Socket\ConnectorInterface;

Expand All @@ -25,8 +25,8 @@ public static function buildEventLoop(): LoopInterface
/**
* Build a React Http Client.
*
* @param ConnectorInterface|null $connector Only pass this argument if you need to customize DNS
* behaviour.
* @param ConnectorInterface|null $connector only pass this argument if you need to customize DNS
* behaviour
*/
public static function buildHttpClient(
LoopInterface $loop,
Expand Down
2 changes: 1 addition & 1 deletion tests/AsyncClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

namespace Http\Adapter\React\Tests;

use Http\Client\Tests\HttpAsyncClientTest;
use Http\Adapter\React\Client;
use Http\Client\HttpAsyncClient;
use Http\Client\Tests\HttpAsyncClientTest;

/**
* @author Stéphane Hulard <s.hulard@chstudio.fr>
Expand Down
2 changes: 1 addition & 1 deletion tests/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Http\Adapter\React\Tests;

use Http\Client\Tests\HttpClientTest;
use Http\Adapter\React\Client;
use Http\Client\Tests\HttpClientTest;
use Psr\Http\Client\ClientInterface;

/**
Expand Down

0 comments on commit 7013b1b

Please sign in to comment.