RegisterFormResourcePass::process()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 22

Duplication

Lines 18
Ratio 81.82 %

Code Coverage

Tests 14
CRAP Score 3

Importance

Changes 0
Metric Value
dl 18
loc 22
ccs 14
cts 14
cp 1
rs 9.568
c 0
b 0
f 0
cc 3
nc 4
nop 1
crap 3
1
<?php
2
3
/*
4
 * This file is part of the Ivory Google Map bundle package.
5
 *
6
 * (c) Eric GELOEN <[email protected]>
7
 *
8
 * For the full copyright and license information, please read the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Ivory\GoogleMapBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * @author GeLo <[email protected]>
19
 */
20
class RegisterFormResourcePass implements CompilerPassInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25 56
    public function process(ContainerBuilder $container)
26
    {
27 56 View Code Duplication
        if ($container->hasParameter($parameter = 'templating.helper.form.resources')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28 1
            $container->setParameter(
29 1
                $parameter,
30 1
                array_merge(
31 1
                    ['@IvoryGoogleMapBundle/Form'],
32 1
                    $container->getParameter($parameter)
33
                )
34
            );
35
        }
36
37 56 View Code Duplication
        if ($container->hasParameter($parameter = 'twig.form.resources')) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
38 1
            $container->setParameter(
39 1
                $parameter,
40 1
                array_merge(
41 1
                    ['@IvoryGoogleMap/Form/place_autocomplete_widget.html.twig'],
42 1
                    $container->getParameter($parameter)
43
                )
44
            );
45
        }
46 56
    }
47
}
48