From f0ac54abc34f00e53e102947ac7a5d2a02fb6cb1 Mon Sep 17 00:00:00 2001 From: Valentin Claras Date: Wed, 17 Mar 2021 22:17:41 +0100 Subject: [PATCH] fix: update code style --- src/Adapter/Amp/Internal/Deferred.php | 8 ++------ src/Adapter/Amp/Internal/PromiseWrapper.php | 4 +--- src/Adapter/Guzzle/CurlMultiClientWrapper.php | 8 ++------ src/Adapter/Guzzle/HttpClient.php | 8 ++------ src/Adapter/ReactPhp/EventLoop.php | 2 +- src/Adapter/ReactPhp/Internal/Deferred.php | 8 ++------ src/Adapter/ReactPhp/Internal/PromiseWrapper.php | 4 +--- src/Adapter/Tornado/Internal/StreamEventLoop.php | 12 +++--------- src/Adapter/Tornado/SynchronousEventLoop.php | 4 +--- tests/Adapter/Guzzle/GuzzleMockWrapper.php | 12 +++--------- 10 files changed, 18 insertions(+), 52 deletions(-) diff --git a/src/Adapter/Amp/Internal/Deferred.php b/src/Adapter/Amp/Internal/Deferred.php index 524d2cf..6b412bd 100644 --- a/src/Adapter/Amp/Internal/Deferred.php +++ b/src/Adapter/Amp/Internal/Deferred.php @@ -10,14 +10,10 @@ */ class Deferred implements \M6Web\Tornado\Deferred { - /** - * @var \Amp\Deferred - */ + /** @var \Amp\Deferred */ private $ampDeferred; - /** - * @var PromiseWrapper - */ + /** @var PromiseWrapper */ private $promise; public function __construct(\Amp\Deferred $ampDeferred, PromiseWrapper $promise) diff --git a/src/Adapter/Amp/Internal/PromiseWrapper.php b/src/Adapter/Amp/Internal/PromiseWrapper.php index abded1e..788c709 100644 --- a/src/Adapter/Amp/Internal/PromiseWrapper.php +++ b/src/Adapter/Amp/Internal/PromiseWrapper.php @@ -11,9 +11,7 @@ */ class PromiseWrapper implements Promise { - /** - * @var \Amp\Promise - */ + /** @var \Amp\Promise */ private $ampPromise; /** @var bool */ diff --git a/src/Adapter/Guzzle/CurlMultiClientWrapper.php b/src/Adapter/Guzzle/CurlMultiClientWrapper.php index bf78f07..6c72bf8 100644 --- a/src/Adapter/Guzzle/CurlMultiClientWrapper.php +++ b/src/Adapter/Guzzle/CurlMultiClientWrapper.php @@ -4,14 +4,10 @@ final class CurlMultiClientWrapper implements GuzzleClientWrapper { - /** - * @var \GuzzleHttp\Handler\CurlMultiHandler - */ + /** @var \GuzzleHttp\Handler\CurlMultiHandler */ private $curlMultiHandler; - /** - * @var \GuzzleHttp\Client - */ + /** @var \GuzzleHttp\Client */ private $guzzleClient; /** diff --git a/src/Adapter/Guzzle/HttpClient.php b/src/Adapter/Guzzle/HttpClient.php index 5ed0caf..da38f83 100644 --- a/src/Adapter/Guzzle/HttpClient.php +++ b/src/Adapter/Guzzle/HttpClient.php @@ -10,14 +10,10 @@ class HttpClient implements \M6Web\Tornado\HttpClient { - /** - * @var EventLoop - */ + /** @var EventLoop */ private $eventLoop; - /** - * @var GuzzleClientWrapper - */ + /** @var GuzzleClientWrapper */ private $clientWrapper; private $nbConcurrentRequests = 0; diff --git a/src/Adapter/ReactPhp/EventLoop.php b/src/Adapter/ReactPhp/EventLoop.php index fcc9bab..db4e189 100644 --- a/src/Adapter/ReactPhp/EventLoop.php +++ b/src/Adapter/ReactPhp/EventLoop.php @@ -196,7 +196,7 @@ public function delay(int $milliseconds): Promise { $deferred = $this->deferred(); $this->reactEventLoop->addTimer( - $milliseconds / 1000 /* milliseconds per second */, + $milliseconds / 1000 /* milliseconds per second */ , function () use ($deferred) { $deferred->resolve(null); } diff --git a/src/Adapter/ReactPhp/Internal/Deferred.php b/src/Adapter/ReactPhp/Internal/Deferred.php index cdd0c69..73a79c4 100644 --- a/src/Adapter/ReactPhp/Internal/Deferred.php +++ b/src/Adapter/ReactPhp/Internal/Deferred.php @@ -10,14 +10,10 @@ */ class Deferred implements \M6Web\Tornado\Deferred { - /** - * @var \React\Promise\Deferred - */ + /** @var \React\Promise\Deferred */ private $reactDeferred; - /** - * @var PromiseWrapper - */ + /** @var PromiseWrapper */ private $promise; public function __construct(\React\Promise\Deferred $reactDeferred, PromiseWrapper $promiseWrapper) diff --git a/src/Adapter/ReactPhp/Internal/PromiseWrapper.php b/src/Adapter/ReactPhp/Internal/PromiseWrapper.php index 8bab6df..170819a 100644 --- a/src/Adapter/ReactPhp/Internal/PromiseWrapper.php +++ b/src/Adapter/ReactPhp/Internal/PromiseWrapper.php @@ -11,9 +11,7 @@ */ class PromiseWrapper implements Promise { - /** - * @var \React\Promise\PromiseInterface - */ + /** @var \React\Promise\PromiseInterface */ private $reactPromise; /** @var bool */ diff --git a/src/Adapter/Tornado/Internal/StreamEventLoop.php b/src/Adapter/Tornado/Internal/StreamEventLoop.php index fee6e01..edf848b 100644 --- a/src/Adapter/Tornado/Internal/StreamEventLoop.php +++ b/src/Adapter/Tornado/Internal/StreamEventLoop.php @@ -9,17 +9,11 @@ */ class StreamEventLoop { - /** - * @var resource[] - */ + /** @var resource[] */ private $readStreams = []; - /** - * @var resource[] - */ + /** @var resource[] */ private $writeStreams = []; - /** - * @var PendingPromise[] - */ + /** @var PendingPromise[] */ private $pendingPromises = []; public function readable(EventLoop $eventLoop, $stream): PendingPromise diff --git a/src/Adapter/Tornado/SynchronousEventLoop.php b/src/Adapter/Tornado/SynchronousEventLoop.php index f33afae..21cd4f8 100644 --- a/src/Adapter/Tornado/SynchronousEventLoop.php +++ b/src/Adapter/Tornado/SynchronousEventLoop.php @@ -7,9 +7,7 @@ class SynchronousEventLoop implements \M6Web\Tornado\EventLoop { - /** - * @var \Throwable[] - */ + /** @var \Throwable[] */ private $asyncThrowables = []; /** diff --git a/tests/Adapter/Guzzle/GuzzleMockWrapper.php b/tests/Adapter/Guzzle/GuzzleMockWrapper.php index b5e6acf..e66023b 100644 --- a/tests/Adapter/Guzzle/GuzzleMockWrapper.php +++ b/tests/Adapter/Guzzle/GuzzleMockWrapper.php @@ -7,19 +7,13 @@ final class GuzzleMockWrapper implements GuzzleClientWrapper { - /** - * @var \GuzzleHttp\Client - */ + /** @var \GuzzleHttp\Client */ private $guzzleClient; - /** - * @var array - */ + /** @var array */ private $transactions = []; - /** - * @var int - */ + /** @var int */ public $ticks; public function __construct(array $queue)