ConfigurableExtension.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel\DependencyInjection;
  11. use Symfony\Component\DependencyInjection\ContainerBuilder;
  12. /**
  13. * This extension sub-class provides first-class integration with the
  14. * Config/Definition Component.
  15. *
  16. * You can use this as base class if
  17. *
  18. * a) you use the Config/Definition component for configuration,
  19. * b) your configuration class is named "Configuration", and
  20. * c) the configuration class resides in the DependencyInjection sub-folder.
  21. *
  22. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  23. */
  24. abstract class ConfigurableExtension extends Extension
  25. {
  26. final public function load(array $configs, ContainerBuilder $container): void
  27. {
  28. $this->loadInternal($this->processConfiguration($this->getConfiguration($configs, $container), $configs), $container);
  29. }
  30. /**
  31. * Configures the passed container according to the merged configuration.
  32. *
  33. * @return void
  34. */
  35. abstract protected function loadInternal(array $mergedConfig, ContainerBuilder $container);
  36. }