diff --git a/Command/DotenvDumpCommand.php b/Command/DotenvDumpCommand.php index 4411054..5b3b84e 100644 --- a/Command/DotenvDumpCommand.php +++ b/Command/DotenvDumpCommand.php @@ -33,7 +33,7 @@ final class DotenvDumpCommand extends Command private $projectDir; private $defaultEnv; - public function __construct(string $projectDir, string $defaultEnv = null) + public function __construct(string $projectDir, ?string $defaultEnv = null) { $this->projectDir = $projectDir; $this->defaultEnv = $defaultEnv; diff --git a/Dotenv.php b/Dotenv.php index 685df57..b454452 100644 --- a/Dotenv.php +++ b/Dotenv.php @@ -107,7 +107,7 @@ public function load(string $path, string ...$extraPaths): void * @throws FormatException when a file has a syntax error * @throws PathException when a file does not exist or is not readable */ - public function loadEnv(string $path, string $envKey = null, string $defaultEnv = 'dev', array $testEnvs = ['test'], bool $overrideExistingVars = false): void + public function loadEnv(string $path, ?string $envKey = null, string $defaultEnv = 'dev', array $testEnvs = ['test'], bool $overrideExistingVars = false): void { $k = $envKey ?? $this->envKey; diff --git a/Exception/FormatException.php b/Exception/FormatException.php index 3ac77e5..358fbaa 100644 --- a/Exception/FormatException.php +++ b/Exception/FormatException.php @@ -20,7 +20,7 @@ final class FormatException extends \LogicException implements ExceptionInterfac { private $context; - public function __construct(string $message, FormatExceptionContext $context, int $code = 0, \Throwable $previous = null) + public function __construct(string $message, FormatExceptionContext $context, int $code = 0, ?\Throwable $previous = null) { $this->context = $context; diff --git a/Exception/PathException.php b/Exception/PathException.php index 4a4d717..e432b2e 100644 --- a/Exception/PathException.php +++ b/Exception/PathException.php @@ -18,7 +18,7 @@ */ final class PathException extends \RuntimeException implements ExceptionInterface { - public function __construct(string $path, int $code = 0, \Throwable $previous = null) + public function __construct(string $path, int $code = 0, ?\Throwable $previous = null) { parent::__construct(sprintf('Unable to read the "%s" environment file.', $path), $code, $previous); }