Completed
Push — master ( 2d5dec...70c5e8 )
by Eric
11s
created

ResourceCompilerPass::process()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 22
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 4
Bugs 0 Features 1
Metric Value
c 4
b 0
f 1
dl 0
loc 22
rs 9.2
cc 3
eloc 13
nc 4
nop 1
1
<?php
2
3
/*
4
 * This file is part of the Ivory CKEditor 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\CKEditorBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
/**
18
 * Resource compiler pass.
19
 *
20
 * @author GeLo <[email protected]>
21
 */
22
class ResourceCompilerPass implements CompilerPassInterface
23
{
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function process(ContainerBuilder $container)
28
    {
29
        if ($container->hasParameter($parameter = 'templating.helper.form.resources')) {
30
            $container->setParameter(
31
                $parameter,
32
                array_merge(
33
                    array('IvoryCKEditorBundle:Form'),
34
                    $container->getParameter($parameter)
35
                )
36
            );
37
        }
38
39
        if ($container->hasParameter($parameter = 'twig.form.resources')) {
40
            $container->setParameter(
41
                $parameter,
42
                array_merge(
43
                    array('IvoryCKEditorBundle:Form:ckeditor_widget.html.twig'),
44
                    $container->getParameter($parameter)
45
                )
46
            );
47
        }
48
    }
49
}
50