Bolt\Extension\ConfigTrait::getConfig PHP Method

getConfig() protected method

Returns the config for the extension.
protected getConfig ( ) : array
return array
    protected function getConfig()
    {
        if ($this->config !== null) {
            return $this->config;
        }
        $this->config = $this->getDefaultConfig();
        $app = $this->getContainer();
        $filesystem = $app['filesystem'];
        $file = new YamlFile();
        $filesystem->getFile(sprintf('config://extensions/%s.%s.yml', strtolower($this->getName()), strtolower($this->getVendor())), $file);
        if (!$file->exists()) {
            try {
                $this->copyDistFile($file);
            } catch (\RuntimeException $e) {
                return $this->config;
            }
        }
        $this->addConfig($file);
        $localFile = new YamlFile();
        $file->getParent()->getFile($file->getFilename('.yml') . '_local.yml', $localFile);
        if ($localFile->exists()) {
            $this->addConfig($localFile);
        }
        return $this->config;
    }