Skip to content

Commit 0411285

Browse files
committed
Update to new php-cs-fixer
1 parent 0301d68 commit 0411285

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

.php-cs-fixer.dist.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
$config = new class extends Amp\CodeStyle\Config {
4+
public function getRules(): array
5+
{
6+
$rules = parent::getRules();
7+
$rules['declare_strict_types'] = false;
8+
9+
return $rules;
10+
}
11+
};
12+
13+
$config->getFinder()
14+
->in(__DIR__ . '/src')
15+
->in(__DIR__ . '/test');
16+
17+
$config->setCacheFile(__DIR__ . '/.php_cs.cache');
18+
19+
return $config;

.php_cs.dist

Lines changed: 0 additions & 12 deletions
This file was deleted.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
},
2323
"require-dev": {
2424
"amphp/amp": "^2",
25-
"amphp/php-cs-fixer-config": "dev-master"
25+
"amphp/php-cs-fixer-config": "^2"
2626
},
2727
"autoload": {
2828
"psr-4": {

src/AsyncTestCase.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ final public function runAsyncTest(...$args)
5454
if (!$this->setUpInvoked) {
5555
$this->fail(\sprintf(
5656
'%s::setUp() overrides %s::setUp() without calling the parent method',
57-
\str_replace("\0", '@', \get_class($this)), // replace NUL-byte in anonymous class name
57+
\str_replace("\0", '@', static::class), // replace NUL-byte in anonymous class name
5858
self::class
5959
));
6060
}
@@ -129,7 +129,7 @@ private function runAsyncTestCycle(array $args): \Generator
129129
} catch (\Throwable $exception) {
130130
throw new \Error(\sprintf(
131131
'%s::setUpAsync() failed',
132-
\str_replace("\0", '@', \get_class($this)) // replace NUL-byte in anonymous class name
132+
\str_replace("\0", '@', static::class) // replace NUL-byte in anonymous class name
133133
), 0, $exception);
134134
}
135135

@@ -144,7 +144,7 @@ private function runAsyncTestCycle(array $args): \Generator
144144
} catch (\Throwable $exception) {
145145
throw new \Error(\sprintf(
146146
'%s::tearDownAsync() failed',
147-
\str_replace("\0", '@', \get_class($this)) // replace NUL-byte in anonymous class name
147+
\str_replace("\0", '@', static::class) // replace NUL-byte in anonymous class name
148148
), 0, $exception);
149149
} finally {
150150
if (isset($testException)) {
@@ -256,11 +256,6 @@ final protected function createCallback(int $invocationCount, ?callable $returnC
256256

257257
/**
258258
* Specialized Amp\call that stores the generator if present for debugging purposes.
259-
*
260-
* @param callable $callback
261-
* @param mixed ...$args
262-
*
263-
* @return Promise
264259
*/
265260
private function call(callable $callback, ...$args): Promise
266261
{

test/AsyncTestCaseTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ public function argumentSupportProvider(): array
9292
}
9393

9494
/**
95-
* @param string $foo
96-
* @param int $bar
97-
* @param bool $baz
98-
*
9995
* @dataProvider argumentSupportProvider
10096
*/
10197
public function testArgumentSupport(string $foo, int $bar, bool $baz)
@@ -106,11 +102,9 @@ public function testArgumentSupport(string $foo, int $bar, bool $baz)
106102
}
107103

108104
/**
109-
* @param string|null $value
110-
*
111105
* @depends testReturningPromise
112106
*/
113-
public function testReturnValueFromDependentTest(string $value = null)
107+
public function testReturnValueFromDependentTest(?string $value = null)
114108
{
115109
$this->assertSame('value', $value);
116110
}

0 commit comments

Comments
 (0)