Skip to content

Commit

Permalink
fix phpstan repored issues
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Jan 14, 2024
1 parent fde47b0 commit deb846b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion phpstan.dist.neon
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ parameters:
-
message: '#^Method PhpCsFixer\\Tests\\.+::provide.+Cases\(\) return type has no value type specified in iterable type iterable\.$#'
path: tests
count: 1034
count: 1025

-
message: '#Call to static method .+ with .+ will always evaluate to true.$#'
Expand Down
3 changes: 3 additions & 0 deletions tests/Fixer/ReturnNotation/NoUselessReturnFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public function testFix(string $expected, ?string $input = null): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideFixCases(): iterable
{
yield [
Expand Down
21 changes: 21 additions & 0 deletions tests/Fixer/ReturnNotation/ReturnAssignmentFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ public function testFixNestedFunctions(string $expected, string $input): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideFixNestedFunctionsCases(): iterable
{
yield [
Expand Down Expand Up @@ -189,6 +192,9 @@ public function testFix(string $expected, string $input): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideFixCases(): iterable
{
yield [
Expand Down Expand Up @@ -819,6 +825,9 @@ public function testDoNotFix(string $expected): void
$this->doTest($expected);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideDoNotFixCases(): iterable
{
yield 'invalid reference stays invalid' => [
Expand Down Expand Up @@ -1261,6 +1270,9 @@ public function testDoNotFix80(string $expected): void
$this->doTest($expected);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideDoNotFix80Cases(): iterable
{
yield 'try with non-capturing catch block' => [
Expand Down Expand Up @@ -1291,6 +1303,9 @@ public function testRepetitiveFix(string $expected, ?string $input = null): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideRepetitiveFixCases(): iterable
{
yield [
Expand Down Expand Up @@ -1344,6 +1359,9 @@ public function testFix80(string $expected, ?string $input = null): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideFix80Cases(): iterable
{
yield 'match' => [
Expand Down Expand Up @@ -1394,6 +1412,9 @@ public function testFixPhp83(string $expected, ?string $input = null): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideFixPhp83Cases(): iterable
{
yield 'anonymous readonly class' => [
Expand Down
6 changes: 6 additions & 0 deletions tests/Fixer/ReturnNotation/SimplifiedNullReturnFixerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ public function testFix(string $expected, ?string $input = null): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideFixCases(): iterable
{
// check correct statements aren't changed
Expand Down Expand Up @@ -101,6 +104,9 @@ public function testFix80(string $expected, ?string $input = null): void
$this->doTest($expected, $input);
}

/**
* @return iterable<array{0: non-empty-string, 1?: non-empty-string}>
*/
public static function provideFix80Cases(): iterable
{
yield [
Expand Down

0 comments on commit deb846b

Please sign in to comment.