src/ServiceProvider/ConfigServiceProvider.php
public function setup(\Pimple $app)
    {
        $app['config'] = $app::share(function () : SimpleConfig {
            $ext = strtolower(pathinfo($this->filename, PATHINFO_EXTENSION));
            if (\in_array($ext, ['ini', 'json', 'yml', 'yaml'], true)) {
                $loader = new FileLoader(new FileLocator(), $this->getParser($ext));
                $config = (new FileConfig($loader))->load($this->filename, $this->placeholders);
            } elseif ($ext === 'php') {
                $config = (new SimpleConfig(require $this->filename, $this->placeholders));
            } else {
                throw new \DomainException(sprintf('The file "%s" is not supported.', $this->filename));
            }
            return $config;
        });
    }
public function setup(\Pimple $app)
    {
        $app['config'] = $app::share(function () : SimpleConfig {
            $ext = strtolower(pathinfo($this->filename, PATHINFO_EXTENSION));
            if (\in_array($ext, ['ini', 'json', 'yml', 'yaml'], true)) {
                $loader = new FileLoader(new FileLocator(), $this->getParser($ext));
                $config = (new FileConfig($loader))->load($this->filename, $this->placeholders);
            } elseif ($ext === 'php') {
                $config = (new SimpleConfig(require $this->filename, $this->placeholders));
            } else {
                throw new \DomainException(sprintf('The file "%s" is not supported.', $this->filename));
            }
            return $config;
        });
    }
@param \Pimple $app

@throws \InvalidArgumentException
@throws \Exception
@throws \DomainException

@api