Skip to content

Commit

Permalink
PHP 8.4: Implicitly marking parameter as nullable is deprecated, the …
Browse files Browse the repository at this point in the history
…explicit nullable type must be used instead.
  • Loading branch information
Soean committed Nov 22, 2024
1 parent c19c325 commit 4f9e70f
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Env/WordPressEnvBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Cli/PhpToolProcessFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/Cli/WpCliToolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions tests/src/IntegrationTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down Expand Up @@ -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(
Expand All @@ -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),
Expand All @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion tests/src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Util/RequirementsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4f9e70f

Please sign in to comment.