From 2af7104e3d652c1546b1b81dacee0243862075c4 Mon Sep 17 00:00:00 2001 From: misantron Date: Tue, 30 Jan 2018 21:56:39 +0300 Subject: [PATCH] Variable annotation added --- src/ConfigServiceProvider.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ConfigServiceProvider.php b/src/ConfigServiceProvider.php index ea00416..6fa8fce 100644 --- a/src/ConfigServiceProvider.php +++ b/src/ConfigServiceProvider.php @@ -37,6 +37,7 @@ public function __construct(ConfigAdapter $adapter, array $paths, array $replace $files = array_filter($paths, function ($file) { return file_exists($file); }); + /** @var array $config */ $config = array_reduce($files, function (array $carry, string $path) use ($adapter) { $file = new \SplFileInfo($path); if ($file->isFile()) { @@ -46,7 +47,7 @@ public function __construct(ConfigAdapter $adapter, array $paths, array $replace return $carry; }, []); - if (empty($config)) { + if (empty($config) || !is_array($config)) { throw new \RuntimeException('Config is empty'); }