From 4f9e70fca45f0ac50bd07e015ee2e8ed2ae4aa03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20W=C3=BCnsch?= Date: Fri, 22 Nov 2024 10:29:38 +0100 Subject: [PATCH] PHP 8.4: Implicitly marking parameter as nullable is deprecated, the explicit nullable type must be used instead. --- src/Env/WordPressEnvBridge.php | 2 +- tests/integration/Cli/PhpToolProcessFactoryTest.php | 2 +- tests/integration/Cli/WpCliToolTest.php | 2 +- tests/src/IntegrationTestCase.php | 8 ++++---- tests/src/TestCase.php | 2 +- tests/unit/Util/RequirementsTest.php | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Env/WordPressEnvBridge.php b/src/Env/WordPressEnvBridge.php index 5576d76..7f3dc2f 100644 --- a/src/Env/WordPressEnvBridge.php +++ b/src/Env/WordPressEnvBridge.php @@ -331,7 +331,7 @@ public static function loadedVars(): array /** * @param Dotenv|null $dotenv */ - public function __construct(Dotenv $dotenv = null) + public function __construct(?Dotenv $dotenv = null) { $this->dotenv = $dotenv; } diff --git a/tests/integration/Cli/PhpToolProcessFactoryTest.php b/tests/integration/Cli/PhpToolProcessFactoryTest.php index 29fa6e3..f2c5747 100644 --- a/tests/integration/Cli/PhpToolProcessFactoryTest.php +++ b/tests/integration/Cli/PhpToolProcessFactoryTest.php @@ -215,7 +215,7 @@ private function assertProcessWorks(PhpToolProcess $process): void * @return PhpToolProcessFactory */ private function factoryPhpToolProcessFactory( - UrlDownloader $urlDownloader = null + ?UrlDownloader $urlDownloader = null ): PhpToolProcessFactory { $composer = $this->factoryComposer(); diff --git a/tests/integration/Cli/WpCliToolTest.php b/tests/integration/Cli/WpCliToolTest.php index 8d5b540..18fbf75 100644 --- a/tests/integration/Cli/WpCliToolTest.php +++ b/tests/integration/Cli/WpCliToolTest.php @@ -151,7 +151,7 @@ public function testCheckPharError(): void * @param string|null $cwd * @return WpCliTool */ - private function factoryTool(string $cwd = null): WpCliTool + private function factoryTool(?string $cwd = null): WpCliTool { return new WpCliTool( new Config( diff --git a/tests/src/IntegrationTestCase.php b/tests/src/IntegrationTestCase.php index 5277f4a..ec45c60 100644 --- a/tests/src/IntegrationTestCase.php +++ b/tests/src/IntegrationTestCase.php @@ -142,7 +142,7 @@ protected function factoryComposerIo( * @return Paths */ protected function factoryPaths( - string $cwd = null, + ?string $cwd = null, int $verbosity = OutputInterface::VERBOSITY_NORMAL, string $input = '', array $extra = [] @@ -171,7 +171,7 @@ protected function factoryPaths( protected function factoryComposerConfig( string $input = '', int $verbosity = OutputInterface::VERBOSITY_NORMAL, - string $cwd = null + ?string $cwd = null ): Composer\Config { return Composer\Factory::createConfig( @@ -194,7 +194,7 @@ protected function factoryComposer(): Composer\Composer * @param string $cwd * @return SystemProcess */ - protected function factorySystemProcess(string $cwd = null): SystemProcess + protected function factorySystemProcess(?string $cwd = null): SystemProcess { return new SystemProcess( $this->factoryPaths($cwd), @@ -206,7 +206,7 @@ protected function factorySystemProcess(string $cwd = null): SystemProcess * @param string $cwd * @return PhpProcess */ - protected function factoryPhpProcess(string $cwd = null): PhpProcess + protected function factoryPhpProcess(?string $cwd = null): PhpProcess { $php = (new PhpExecutableFinder())->find() ?: 'php'; diff --git a/tests/src/TestCase.php b/tests/src/TestCase.php index 7949f70..e630408 100644 --- a/tests/src/TestCase.php +++ b/tests/src/TestCase.php @@ -154,7 +154,7 @@ protected function factoryLocator(...$objects): Util\Locator * @param array|null $extra * @return Util\Paths */ - protected function factoryPaths(array $extra = null): Util\Paths + protected function factoryPaths(?array $extra = null): Util\Paths { $root = $this->fixturesPath() . '/paths-root'; diff --git a/tests/unit/Util/RequirementsTest.php b/tests/unit/Util/RequirementsTest.php index 7e66109..17487de 100644 --- a/tests/unit/Util/RequirementsTest.php +++ b/tests/unit/Util/RequirementsTest.php @@ -175,7 +175,7 @@ public function testConfigsLoadedFromDefaultFileAreMerged() * @param string $customRoot * @return mixed */ - private function executeExtractConfig(array $extra, string $customRoot = null): array + private function executeExtractConfig(array $extra, ?string $customRoot = null): array { $tester = \Closure::bind( function (string $rootPath) use ($extra): array {