Completed
Pull Request — master (#47)
by Maximilian
62:08 queued 57s
created

ResourceCompilerPass   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 28
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 22 3
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 FOS\CKEditorBundle\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 ResourceCompilerPass implements CompilerPassInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function process(ContainerBuilder $container)
26
    {
27
        if ($container->hasParameter($parameter = 'templating.helper.form.resources')) {
28
            $container->setParameter(
29
                $parameter,
30
                array_merge(
31
                    ['FOSCKEditorBundle:Form'],
32
                    $container->getParameter($parameter)
33
                )
34
            );
35
        }
36
37
        if ($container->hasParameter($parameter = 'twig.form.resources')) {
38
            $container->setParameter(
39
                $parameter,
40
                array_merge(
41
                    ['@FOSCKEditor/Form/ckeditor_widget.html.twig'],
42
                    $container->getParameter($parameter)
43
                )
44
            );
45
        }
46
    }
47
}
48