Skip to content

Commit 9f04af5

Browse files
authored
Merge pull request #28 from helhum/fix-default
2 parents fefbd85 + 4649ac0 commit 9f04af5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"require": {
66
"php": ">=7.2",
77
"ext-json": "*",
8-
"helhum/config-loader": ">=0.9 <0.13",
8+
"helhum/config-loader": ">=0.12.4 <0.13",
99
"helhum/typo3-console": "^5.7 || ^6.0 || ^7.0",
1010
"symfony/console": "^4.0 || ^5.0",
1111
"symfony/yaml": "^4.0 || ^5.0",

src/ConfigReader/ArrayReader.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
***************************************************************/
2424

2525
use Helhum\ConfigLoader\Config;
26+
use Helhum\ConfigLoader\PathDoesNotExistException;
2627
use Helhum\ConfigLoader\Reader\ConfigReaderInterface;
2728

2829
class ArrayReader implements ConfigReaderInterface
@@ -46,12 +47,15 @@ public function __construct(array $config, string $configPath = null)
4647
public function hasConfig(): bool
4748
{
4849
if ($this->configPath) {
49-
$config = Config::getValue($this->config, $this->configPath, []);
50-
51-
return \is_array($config) && $config !== [];
50+
try {
51+
Config::getValue($this->config, $this->configPath, []);
52+
return true;
53+
} catch (PathDoesNotExistException $e) {
54+
return false;
55+
}
5256
}
5357

54-
return $this->config !== [];
58+
return true;
5559
}
5660

5761
public function readConfig(): array

0 commit comments

Comments
 (0)