From cdeb29ad80789c46a38eaf45f47ca10fd426a0d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20FIDRY?= Date: Fri, 6 Oct 2023 17:52:00 +0200 Subject: [PATCH] cs: Apply the new PHP-CS-Fixer rules --- requirement-checker/src/RequirementCollection.php | 2 +- requirement-checker/tests/CheckerTest.php | 3 +-- requirement-checker/tests/IOTest.php | 5 ++--- requirement-checker/tests/PrinterTest.php | 7 +++---- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/requirement-checker/src/RequirementCollection.php b/requirement-checker/src/RequirementCollection.php index 6b12ff9b7..75d0484ab 100644 --- a/requirement-checker/src/RequirementCollection.php +++ b/requirement-checker/src/RequirementCollection.php @@ -93,7 +93,7 @@ public function evaluateRequirements() { return array_reduce( $this->requirements, - function (bool $checkPassed, Requirement $requirement): bool { + static function (bool $checkPassed, Requirement $requirement): bool { return $checkPassed && $requirement->isFulfilled(); }, true diff --git a/requirement-checker/tests/CheckerTest.php b/requirement-checker/tests/CheckerTest.php index 1fdf1cf34..9c16f17f7 100644 --- a/requirement-checker/tests/CheckerTest.php +++ b/requirement-checker/tests/CheckerTest.php @@ -14,7 +14,6 @@ namespace KevinGH\RequirementChecker; -use Generator; use PHPUnit\Framework\TestCase; use function preg_replace; use const PHP_VERSION; @@ -60,7 +59,7 @@ public function test_it_can_check_requirements( self::assertSame($expectedResult, $actualResult); } - public function provideRequirements(): Generator + public function provideRequirements(): iterable { $phpVersion = PHP_VERSION; $remainingVerbosities = ['verbosity=verbose' => IO::VERBOSITY_VERBOSE, 'verbosity=normal' => IO::VERBOSITY_NORMAL, 'verbosity=quiet' => IO::VERBOSITY_QUIET]; diff --git a/requirement-checker/tests/IOTest.php b/requirement-checker/tests/IOTest.php index e5a7976c8..bbe143393 100644 --- a/requirement-checker/tests/IOTest.php +++ b/requirement-checker/tests/IOTest.php @@ -14,7 +14,6 @@ namespace KevinGH\RequirementChecker; -use Generator; use PHPUnit\Framework\TestCase; use function function_exists; use function getenv; @@ -67,7 +66,7 @@ public function test_it_uses_the_shell_verbosity_environment_variable_over_the_o self::assertSame($verbosity, $io->getVerbosity()); } - public function provideOptions(): Generator + public function provideOptions(): iterable { yield [ ['cli.php', '--foo'], @@ -160,7 +159,7 @@ public function provideOptions(): Generator ]; } - public function provideOptionsWithShellVerbosity(): Generator + public function provideOptionsWithShellVerbosity(): iterable { yield [ ['cli.php', '--foo'], diff --git a/requirement-checker/tests/PrinterTest.php b/requirement-checker/tests/PrinterTest.php index 31b7494f8..56468faa5 100644 --- a/requirement-checker/tests/PrinterTest.php +++ b/requirement-checker/tests/PrinterTest.php @@ -14,7 +14,6 @@ namespace KevinGH\RequirementChecker; -use Generator; use PHPUnit\Framework\TestCase; use function ob_get_clean; use function ob_start; @@ -82,7 +81,7 @@ public function test_it_can_print_a_block( self::assertSame($expected, $actual); } - public function provideTitles(): Generator + public function provideTitles(): iterable { yield [ IO::VERBOSITY_NORMAL, @@ -171,7 +170,7 @@ public function provideTitles(): Generator ]; } - public function provideErrorRequirements(): Generator + public function provideErrorRequirements(): iterable { yield [ new Requirement( @@ -216,7 +215,7 @@ public function provideErrorRequirements(): Generator ]; } - public function provideBlocks(): Generator + public function provideBlocks(): iterable { yield [ IO::VERBOSITY_NORMAL,