Skip to content

Fix ci builds #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 <[email protected]>
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