FreshDoctrineEnumExtension::load()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 9
rs 9.9666
c 0
b 0
f 0
cc 2
nc 2
nop 2
1
<?php
2
/*
3
 * This file is part of the FreshDoctrineEnumBundle.
4
 *
5
 * (c) Artem Henvald <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
declare(strict_types=1);
12
13
namespace Fresh\DoctrineEnumBundle\DependencyInjection;
14
15
use Symfony\Component\Config\FileLocator;
16
use Symfony\Component\DependencyInjection\ContainerBuilder;
17
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
18
use Symfony\Component\Form\FormTypeGuesserInterface;
19
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
20
21
/**
22
 * This is the class that loads and manages FreshDoctrineEnumBundle configuration.
23
 *
24
 * @author Artem Henvald <[email protected]>
25
 */
26
class FreshDoctrineEnumExtension extends Extension
27
{
28
    /**
29
     * @param mixed[]          $configs
30
     * @param ContainerBuilder $container
31
     */
32
    public function load(array $configs, ContainerBuilder $container): void
33
    {
34
        $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
35
        $loader->load('services.yaml');
36
37
        if (\interface_exists(FormTypeGuesserInterface::class)) {
38
            $loader->load('form_type_guesser.yaml');
39
        }
40
    }
41
}
42