From d44407be6ca02dad202c08a9fd782f4c32b9936f Mon Sep 17 00:00:00 2001 From: Ayesh Karunaratne Date: Sat, 16 Mar 2024 02:39:58 +0700 Subject: [PATCH 1/2] [PHP 8.4] Fixes for implicit nullability deprecation Fixes all issues that emit deprecation notices on PHP 8.4 for implicit nullable parameter type declarations. See: - [RFC](https://wiki.php.net/rfc/deprecate-implicitly-nullable-types) - [PHP 8.4: Implicitly nullable parameter declarations deprecated](https://php.watch/versions/8.4/implicitly-marking-parameter-type-nullable-deprecated) --- src/Manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager.php b/src/Manager.php index cedc414..676a1fd 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -33,7 +33,7 @@ class Manager * @return Result * @throws ParallelLintException */ - public function run(Settings $settings = null) + public function run(?Settings $settings = null) { $settings = $settings ?: new Settings(); $output = $this->output ?: $this->getDefaultOutput($settings); From 0c3787806470f201ee7240c64736f5b5975a15e0 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Sat, 16 Mar 2024 19:57:34 +0100 Subject: [PATCH 2/2] Make PHP 8.4 implicit nullability fix compatible with PHP < 7.1 --- src/Manager.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Manager.php b/src/Manager.php index 676a1fd..3e2470b 100644 --- a/src/Manager.php +++ b/src/Manager.php @@ -33,9 +33,9 @@ class Manager * @return Result * @throws ParallelLintException */ - public function run(?Settings $settings = null) + public function run($settings = null) { - $settings = $settings ?: new Settings(); + $settings = ($settings instanceof Settings) ? $settings : new Settings(); $output = $this->output ?: $this->getDefaultOutput($settings); $phpExecutable = PhpExecutable::getPhpExecutable($settings->phpExecutable);