Skip to content

Commit

Permalink
[#ests] - minor corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
niden committed Feb 18, 2024
1 parent 660da28 commit 2743f3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Config/Adapter/Yaml.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
}

Expand Down
10 changes: 5 additions & 5 deletions src/Config/ConfigFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,22 @@ 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);

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);
}
}

Expand Down

0 comments on commit 2743f3a

Please sign in to comment.