You are here

protected function Extension::isConfigEnabled in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/dependency-injection/Extension/Extension.php \Symfony\Component\DependencyInjection\Extension\Extension::isConfigEnabled()

Parameters

ContainerBuilder $container:

array $config:

Return value

bool Whether the configuration is enabled

Throws

InvalidArgumentException When the config is not enableable

File

vendor/symfony/dependency-injection/Extension/Extension.php, line 116

Class

Extension
Provides useful features shared by many extensions.

Namespace

Symfony\Component\DependencyInjection\Extension

Code

protected function isConfigEnabled(ContainerBuilder $container, array $config) {
  if (!array_key_exists('enabled', $config)) {
    throw new InvalidArgumentException("The config array has no 'enabled' key.");
  }
  return (bool) $container
    ->getParameterBag()
    ->resolveValue($config['enabled']);
}