-
Notifications
You must be signed in to change notification settings - Fork 0
/
MetricsPowerExtension.php
36 lines (30 loc) · 1.35 KB
/
MetricsPowerExtension.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
/**
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
*
* Copyright (c) 2024 Mykhailo Shtanko [email protected]
*
* For the full copyright and license information, please view the LICENSE.MD
* file that was distributed with this source code.
*/
namespace FRZB\Component\MetricsPower;
use FRZB\Component\MetricsPower\DependencyInjection\Configuration;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
final class MetricsPowerExtension extends Extension
{
/** @throws \Throwable */
public function load(array $configs, ContainerBuilder $container): void
{
$metricsPowerConfiguration = new Configuration();
$metricsPowerProcessedConfiguration = $this->processConfiguration($metricsPowerConfiguration, $configs);
$loader = (new YamlFileLoader($container, new FileLocator(__DIR__.'/Resources/config')));
$container->setParameter(Configuration::METRICS_POWER_CONFIG, $metricsPowerProcessedConfiguration);
$loader->load('services.yaml');
}
}