From 18010809f18463ac82409dc59543e1a687741cab Mon Sep 17 00:00:00 2001 From: Valentin CLARAS Date: Wed, 1 Sep 2021 12:42:39 +0200 Subject: [PATCH] feat: php-cs configuration and fix the code style's errors --- .gitignore | 2 +- .php-cs-fixer.dist.php | 15 +++++++++++++++ .php_cs | 11 ----------- composer.json | 2 +- src/Deferred.php | 1 + src/EventLoop.php | 1 + tests/EventLoopTest/PromiseForeachTest.php | 1 + 7 files changed, 20 insertions(+), 13 deletions(-) create mode 100644 .php-cs-fixer.dist.php delete mode 100644 .php_cs diff --git a/.gitignore b/.gitignore index 618b5de..40f9b08 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /bin/ /vendor/ /composer.lock -/.php_cs.cache +/.php-cs-fixer.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..de8fa1d --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,15 @@ +in( + [ + __DIR__.'/src', + __DIR__.'/tests', + __DIR__.'/examples', + ] +); + +$config = new M6Web\CS\Config\BedrockStreaming(); +$config->setFinder($finder); + +return $config; diff --git a/.php_cs b/.php_cs deleted file mode 100644 index 4dab648..0000000 --- a/.php_cs +++ /dev/null @@ -1,11 +0,0 @@ -getFinder() - ->in([ - __DIR__.'/src', - __DIR__.'/tests', - __DIR__.'/examples', - ])->exclude([ - ]); - -return $config; diff --git a/composer.json b/composer.json index b99aac2..556d560 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "phpunit/phpunit": "^7.3", "amphp/amp": "^2.0", "guzzlehttp/guzzle": "^6.3", - "m6web/php-cs-fixer-config": "^1.0", + "m6web/php-cs-fixer-config": "^2.0", "ext-curl": "^7.1", "react/event-loop": "^1.0", "react/promise": "^2.7", diff --git a/src/Deferred.php b/src/Deferred.php index 95a2398..b109805 100644 --- a/src/Deferred.php +++ b/src/Deferred.php @@ -14,6 +14,7 @@ public function getPromise(): Promise; /** * Resolves associated promise. + * * @param mixed $value */ public function resolve($value): void; diff --git a/src/EventLoop.php b/src/EventLoop.php index 15fee71..f249583 100644 --- a/src/EventLoop.php +++ b/src/EventLoop.php @@ -40,6 +40,7 @@ public function promiseRace(Promise ...$promises): Promise; /** * Creates a promise already resolved with $value. + * * @param mixed $value */ public function promiseFulfilled($value): Promise; diff --git a/tests/EventLoopTest/PromiseForeachTest.php b/tests/EventLoopTest/PromiseForeachTest.php index 5d46b46..dfb6e79 100644 --- a/tests/EventLoopTest/PromiseForeachTest.php +++ b/tests/EventLoopTest/PromiseForeachTest.php @@ -10,6 +10,7 @@ abstract protected function createEventLoop(): EventLoop; /** * Helper function to test that promiseForeach works for array AND iterator inputs. + * * @param mixed[] $input * @param mixed[] $expected */