Completed
Push — master ( 0f15f1...06dce9 )
by Pavel
09:44
created

SymfonyFormsCompilerPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2.0185

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 6
cp 0.8333
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
crap 2.0185
1
<?php
2
3
namespace ScayTrase\Api\Cruds\DependencyInjection\Compiler;
4
5
use Symfony\Component\Config\FileLocator;
6
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\DependencyInjection\Loader;
9
10
final class SymfonyFormsCompilerPass implements CompilerPassInterface
11
{
12
    /** {@inheritdoc} */
13 22
    public function process(ContainerBuilder $container)
14
    {
15 22
        if (!$container->has('form.factory')) {
16
            return;
17
        }
18
19 22
        $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../../Resources/config'));
20 22
        $loader->load('forms.yml');
21 22
    }
22
}
23