1 <?php
declare(strict_types
=1);
4 * This file is part of the Rapsys PackBundle package.
6 * (c) Raphaël Gertz <symfony@rapsys.eu>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Rapsys\PackBundle\DependencyInjection
;
14 use Symfony\Component\DependencyInjection\ContainerBuilder
;
15 use Symfony\Component\DependencyInjection\Extension\Extension
;
18 * This is the class that loads and manages your bundle configuration.
20 * @link http://symfony.com/doc/current/cookbook/bundles/extension.html
24 class RapsysPackExtension
extends Extension
{
28 public function load(array $configs, ContainerBuilder
$container): void {
30 $configuration = $this->getConfiguration($configs, $container);
32 //Process the configuration to get merged config
33 $config = $this->processConfiguration($configuration, $configs);
35 //Detect when no user configuration is provided
36 if ($configs === [[]]) {
37 //Prepend default config
38 $container->prependExtensionConfig($this->getAlias(), $config);
41 //Save configuration in parameters
42 $container->setParameter($this->getAlias(), $config);
48 public function getAlias(): string {