diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..d323b15 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,19 @@ +getFinder() + ->in(__DIR__ . '/src') + ->in(__DIR__ . '/test'); + +$config->setCacheFile(__DIR__ . '/.php_cs.cache'); + +return $config; diff --git a/.php_cs.dist b/.php_cs.dist deleted file mode 100644 index cd06abc..0000000 --- a/.php_cs.dist +++ /dev/null @@ -1,12 +0,0 @@ -getFinder() - ->in(__DIR__ . '/src') - ->in(__DIR__ . '/test'); - -$cacheDir = getenv('TRAVIS') ? getenv('HOME') . '/.php-cs-fixer' : __DIR__; - -$config->setCacheFile($cacheDir . '/.php_cs.cache'); - -return $config; diff --git a/composer.json b/composer.json index 677e41c..79cbd0d 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ }, "require-dev": { "amphp/amp": "^2", - "amphp/php-cs-fixer-config": "dev-master" + "amphp/php-cs-fixer-config": "^2" }, "autoload": { "psr-4": { diff --git a/src/AsyncTestCase.php b/src/AsyncTestCase.php index e16a11c..1cb0ac2 100644 --- a/src/AsyncTestCase.php +++ b/src/AsyncTestCase.php @@ -54,7 +54,7 @@ final public function runAsyncTest(...$args) if (!$this->setUpInvoked) { $this->fail(\sprintf( '%s::setUp() overrides %s::setUp() without calling the parent method', - \str_replace("\0", '@', \get_class($this)), // replace NUL-byte in anonymous class name + \str_replace("\0", '@', static::class), // replace NUL-byte in anonymous class name self::class )); } @@ -129,7 +129,7 @@ private function runAsyncTestCycle(array $args): \Generator } catch (\Throwable $exception) { throw new \Error(\sprintf( '%s::setUpAsync() failed', - \str_replace("\0", '@', \get_class($this)) // replace NUL-byte in anonymous class name + \str_replace("\0", '@', static::class) // replace NUL-byte in anonymous class name ), 0, $exception); } @@ -144,7 +144,7 @@ private function runAsyncTestCycle(array $args): \Generator } catch (\Throwable $exception) { throw new \Error(\sprintf( '%s::tearDownAsync() failed', - \str_replace("\0", '@', \get_class($this)) // replace NUL-byte in anonymous class name + \str_replace("\0", '@', static::class) // replace NUL-byte in anonymous class name ), 0, $exception); } finally { if (isset($testException)) { @@ -256,11 +256,6 @@ final protected function createCallback(int $invocationCount, ?callable $returnC /** * Specialized Amp\call that stores the generator if present for debugging purposes. - * - * @param callable $callback - * @param mixed ...$args - * - * @return Promise */ private function call(callable $callback, ...$args): Promise { diff --git a/test/AsyncTestCaseTest.php b/test/AsyncTestCaseTest.php index 3725e8e..5384c4a 100644 --- a/test/AsyncTestCaseTest.php +++ b/test/AsyncTestCaseTest.php @@ -92,10 +92,6 @@ public function argumentSupportProvider(): array } /** - * @param string $foo - * @param int $bar - * @param bool $baz - * * @dataProvider argumentSupportProvider */ public function testArgumentSupport(string $foo, int $bar, bool $baz) @@ -106,11 +102,9 @@ public function testArgumentSupport(string $foo, int $bar, bool $baz) } /** - * @param string|null $value - * * @depends testReturningPromise */ - public function testReturnValueFromDependentTest(string $value = null) + public function testReturnValueFromDependentTest(?string $value = null) { $this->assertSame('value', $value); }