| 1 | <?php |
||
| 21 | final class TestExtension extends Extension |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | private $alias; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param string $alias |
||
| 30 | */ |
||
| 31 | public function __construct(string $alias) |
||
| 32 | { |
||
| 33 | $this->alias = $alias; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * {@inheritdoc} |
||
| 38 | */ |
||
| 39 | public function load(array $configs, ContainerBuilder $container) |
||
| 40 | { |
||
| 41 | $loader = new PhpConfigFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
||
| 42 | $files = [ |
||
| 43 | 'services', |
||
| 44 | ]; |
||
| 45 | foreach ($files as $basename) { |
||
| 46 | $loader->load(sprintf('%s.php', $basename)); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * {@inheritdoc} |
||
| 52 | */ |
||
| 53 | public function getAlias(): string |
||
| 54 | { |
||
| 55 | return $this->alias; |
||
| 56 | } |
||
| 57 | } |
||
| 58 |