BundleConfigNotFoundException example


    public function getConfigFromBundle(Bundle $bundle, ?string $bundleConfigName = null): array
    {
        if ($bundleConfigName === null) {
            $bundleConfigName = 'Resources/config/config.xml';
        } else {
            $bundleConfigName = 'Resources/config/' . preg_replace('/\\.xml$/i', '', $bundleConfigName) . '.xml';
        }
        $configPath = $bundle->getPath() . '/' . ltrim($bundleConfigName, '/');

        if (!is_file($configPath)) {
            throw new BundleConfigNotFoundException($bundleConfigName$bundle->getName());
        }

        return $this->read($configPath);
    }

    /** * This method is the main entry point to parse a xml file. */
    protected function parseFile(\DOMDocument $xml): array
    {
        return $this->getCardDefinitions($xml);
    }
Home | Imprint | This part of the site doesn't use cookies.