diff --git a/.php-cs-fixer.tests.php b/.php-cs-fixer.tests.php index bf37256da58a..412400aebaee 100644 --- a/.php-cs-fixer.tests.php +++ b/.php-cs-fixer.tests.php @@ -31,7 +31,8 @@ ->notName('#Foobar.php$#'); $overrides = [ - 'void_return' => true, + 'phpdoc_to_return_type' => true, + 'void_return' => true, ]; return $config diff --git a/tests/_support/Autoloader/FatalLocator.php b/tests/_support/Autoloader/FatalLocator.php index 0b98fddc6eca..438c41480f01 100644 --- a/tests/_support/Autoloader/FatalLocator.php +++ b/tests/_support/Autoloader/FatalLocator.php @@ -34,7 +34,7 @@ class FatalLocator extends FileLocator * * @return false|string The path to the file, or false if not found. */ - public function locateFile(string $file, ?string $folder = null, string $ext = 'php') + public function locateFile(string $file, ?string $folder = null, string $ext = 'php'): false|string { $folder ??= 'null'; diff --git a/tests/_support/Config/Services.php b/tests/_support/Config/Services.php index 712c79004a0b..3cb7c53388c3 100644 --- a/tests/_support/Config/Services.php +++ b/tests/_support/Config/Services.php @@ -31,10 +31,8 @@ class Services extends BaseServices * The URI class provides a way to model and manipulate URIs. * * @param string|null $uri The URI string - * - * @return URI */ - public static function uri(?string $uri = null, bool $getShared = true) + public static function uri(?string $uri = null, bool $getShared = true): URI { // Intercept our test case if ($uri === 'testCanReplaceFrameworkServices') { diff --git a/tests/_support/Entity/Cast/CastPassParameters.php b/tests/_support/Entity/Cast/CastPassParameters.php index 2cbfce0f324b..3f304e3622a0 100644 --- a/tests/_support/Entity/Cast/CastPassParameters.php +++ b/tests/_support/Entity/Cast/CastPassParameters.php @@ -22,10 +22,8 @@ class CastPassParameters extends BaseCast * * @param mixed $value Data * @param array $params Additional param - * - * @return mixed */ - public static function set($value, array $params = []) + public static function set($value, array $params = []): string { return $value . ':' . json_encode($params); } diff --git a/tests/system/Files/FileTest.php b/tests/system/Files/FileTest.php index b8e82edd02fd..c74c6b63ffeb 100644 --- a/tests/system/Files/FileTest.php +++ b/tests/system/Files/FileTest.php @@ -172,7 +172,7 @@ public function testGetDestination(): void /** * @return array> */ - public static function provideGetSizeData() + public static function provideGetSizeData(): array { return [ 'returns KB binary' => [ diff --git a/tests/system/Models/TimestampModelTest.php b/tests/system/Models/TimestampModelTest.php index ce2675a2d89d..9af7cd3b9547 100644 --- a/tests/system/Models/TimestampModelTest.php +++ b/tests/system/Models/TimestampModelTest.php @@ -40,7 +40,7 @@ protected function tearDown(): void /** * @return int|string Insert ID */ - private function allowDatesPrepareOneRecord(array $data) + private function allowDatesPrepareOneRecord(array $data): int|string { $this->createModel(UserTimestampModel::class); $this->db->table('user')->truncate(); @@ -60,7 +60,7 @@ private function allowDatesPrepareOneRecord(array $data) /** * @return int|string Insert ID */ - private function doNotAllowDatesPrepareOneRecord(array $data) + private function doNotAllowDatesPrepareOneRecord(array $data): int|string { $this->createModel(UserTimestampModel::class); $this->db->table('user')->truncate(); diff --git a/tests/system/Test/BootstrapFCPATHTest.php b/tests/system/Test/BootstrapFCPATHTest.php index cc03ef99b1b7..2af9b87b560d 100644 --- a/tests/system/Test/BootstrapFCPATHTest.php +++ b/tests/system/Test/BootstrapFCPATHTest.php @@ -100,10 +100,7 @@ private function fileContents(): string return $fileContents . 'echo FCPATH;' . PHP_EOL; } - /** - * @return false|string - */ - private function readOutput(string $file) + private function readOutput(string $file): false|string { ob_start(); system('php -f ' . $file);