From 2743f3ad999e657254140a21f852b7460c511c1e Mon Sep 17 00:00:00 2001 From: Nikolaos Dimopoulos Date: Sun, 18 Feb 2024 10:03:43 -0600 Subject: [PATCH] [#ests] - minor corrections --- src/Config/Adapter/Yaml.php | 2 +- src/Config/ConfigFactory.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Config/Adapter/Yaml.php b/src/Config/Adapter/Yaml.php index a555ee7c4..92f6b4943 100644 --- a/src/Config/Adapter/Yaml.php +++ b/src/Config/Adapter/Yaml.php @@ -89,7 +89,7 @@ public function __construct(string $filePath, ?array $callbacks = null) if (false === $yamlConfig) { throw new Exception( - 'Configuration file ' . basename($filePath) . ' can\'t be loaded' + 'Configuration file ' . basename($filePath) . ' cannot be loaded' ); } diff --git a/src/Config/ConfigFactory.php b/src/Config/ConfigFactory.php index dd4c49077..aff9e7993 100644 --- a/src/Config/ConfigFactory.php +++ b/src/Config/ConfigFactory.php @@ -111,7 +111,7 @@ public function load(array | string | Config $config): ConfigInterface */ public function newInstance( string $name, - string $fileName, + string|array $fileNameOrOptions, $params = null ): ConfigInterface { $definition = $this->getService($name); @@ -119,14 +119,14 @@ public function newInstance( switch ($definition) { case Grouped::class: $adapter = null === $params ? 'php' : $params; - return new $definition($fileName, $adapter); + return new $definition($fileNameOrOptions, $adapter); case Ini::class: $mode = null === $params ? INI_SCANNER_RAW : $params; - return new $definition($fileName, $mode); + return new $definition($fileNameOrOptions, $mode); case Yaml::class: - return new $definition($fileName, $params); + return new $definition($fileNameOrOptions, $params); default: - return new $definition($fileName); + return new $definition($fileNameOrOptions); } }