From 5c6e7f91d01a488a21679e79a09765de465eda53 Mon Sep 17 00:00:00 2001 From: Jaume Date: Thu, 28 Nov 2024 19:04:50 +0100 Subject: [PATCH] Fix warning deprecation message for PHP 8.4 Hi again, if I use this package with pho 8.4 I get this warn: ``` Deprecated: PhpDevCommunity\DotEnv::__construct(): Implicitly marking parameter $processors as nullable is deprecated, the explicit nullable type must be used instead in /var/www/api/vendor/phpdevcommunity/php-dotenv/src/DotEnv.php on line 29 Deprecated: PhpDevCommunity\DotEnv::setProcessors(): Implicitly marking parameter $processors as nullable is deprecated, the explicit nullable type must be used instead in /var/www/api/vendor/phpdevcommunity/php-dotenv/src/DotEnv.php on line 69 ``` --- src/DotEnv.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DotEnv.php b/src/DotEnv.php index 63abfb7..338edaa 100644 --- a/src/DotEnv.php +++ b/src/DotEnv.php @@ -26,7 +26,7 @@ class DotEnv */ protected array $processors = []; - public function __construct(string $path, array $processors = null) + public function __construct(string $path, ?array $processors = null) { if (!file_exists($path)) { throw new InvalidArgumentException(sprintf('%s does not exist', $path)); @@ -66,7 +66,7 @@ public function load(): void } } - private function setProcessors(array $processors = null): void + private function setProcessors(?array $processors = null): void { /** * Fill with default processors