From dc59281bc2ef08faef84e5a8990eacfef33c0ab5 Mon Sep 17 00:00:00 2001 From: 8ctopus Date: Wed, 4 Dec 2024 16:34:29 +0400 Subject: [PATCH] Fix php 8.4 deprecations implicitly marking parameter as nullable is deprecated --- src/Config.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Config.php b/src/Config.php index 8838e44..dad3b67 100644 --- a/src/Config.php +++ b/src/Config.php @@ -67,10 +67,10 @@ public static function load($values, $parser = null, $string = false) * Loads a Config instance. * * @param string|array $values Filenames or string with configuration - * @param ParserInterface $parser Configuration parser + * @param ?ParserInterface $parser Configuration parser * @param bool $string Enable loading from string */ - public function __construct($values, ParserInterface $parser = null, $string = false) + public function __construct($values, ?ParserInterface $parser = null, $string = false) { if ($string === true) { $this->loadFromString($values, $parser); @@ -85,11 +85,11 @@ public function __construct($values, ParserInterface $parser = null, $string = f * Loads configuration from file. * * @param string|array $path Filenames or directories with configuration - * @param ParserInterface $parser Configuration parser + * @param ?ParserInterface $parser Configuration parser * * @throws EmptyDirectoryException If `$path` is an empty directory */ - protected function loadFromFile($path, ParserInterface $parser = null) + protected function loadFromFile($path, ?ParserInterface $parser = null) { $paths = $this->getValidPath($path); $this->data = []; @@ -125,11 +125,11 @@ protected function loadFromFile($path, ParserInterface $parser = null) * Writes configuration to file. * * @param string $filename Filename to save configuration to - * @param WriterInterface $writer Configuration writer + * @param ?WriterInterface $writer Configuration writer * * @throws WriteException if the data could not be written to the file */ - public function toFile($filename, WriterInterface $writer = null) + public function toFile($filename, ?WriterInterface $writer = null) { if ($writer === null) { // Get file information