Created function to abstract how to load config from a glob pattern

This commit is contained in:
Alejandro Celaya
2019-08-10 14:09:42 +02:00
parent 3520ab6b18
commit 02ca843944
7 changed files with 48 additions and 14 deletions

View File

@@ -3,13 +3,12 @@ declare(strict_types=1);
namespace Shlinkio\Shlink\Core;
use Zend\Config\Factory;
use Zend\Stdlib\Glob;
use function Shlinkio\Shlink\Common\loadConfigFromGlob;
class ConfigProvider
{
public function __invoke()
{
return Factory::fromFiles(Glob::glob(__DIR__ . '/../config/{,*.}config.php', Glob::GLOB_BRACE));
return loadConfigFromGlob(__DIR__ . '/../config/{,*.}config.php');
}
}