Completed
Push — master ( 2aacfe...7fe43e )
by WEBEWEB
01:09
created

WBWHaveIBeenPwnedExtension::getAlias()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the haveibeenpwned-bundle package.
5
 *
6
 * (c) 2019 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\HaveIBeenPwnedBundle\DependencyInjection;
13
14
use Symfony\Component\Config\FileLocator;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
use Symfony\Component\DependencyInjection\Extension\Extension;
17
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
18
19
/**
20
 * HaveIBeenPwned extension.
21
 *
22
 * @author webeweb <https://github.com/webeweb/>
23
 * @package WBW\Bundle\HaveIBeenPwnedBundle\DependencyInjection
24
 */
25
class WBWHaveIBeenPwnedExtension extends Extension {
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function getAlias() {
31
        return "wbw_haveibeenpwned";
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function load(array $configs, ContainerBuilder $container) {
38
39
        $fileLocator = new FileLocator(__DIR__ . "/../Resources/config");
40
41
        $serviceLoader = new YamlFileLoader($container, $fileLocator);
42
        $serviceLoader->load("services.yml");
43
44
        /** @var ConfigurationInterface $configuration */
45
        $configuration = $this->getConfiguration($configs, $container);
46
47
        $config = $this->processConfiguration($configuration, $configs);
48
49
        if (true === $config["event_listeners"]) {
50
            $serviceLoader->load("event_listeners.yml");
51
        }
52
    }
53
}
54