PluginPass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 14
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 12 2
1
<?php
2
/**
3
 * Copyright (c) 2017
4
 *
5
 * @package   Majima
6
 * @author    David Neustadt <[email protected]>
7
 * @copyright 2017 David Neustadt
8
 * @license   MIT
9
 */
10
11
namespace Majima\PluginBundle\DependencyInjection\Compiler;
12
13
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
16
class PluginPass implements CompilerPassInterface
17
{
18
    public function process(ContainerBuilder $container)
19
    {
20
        /*
21
         * Register Plugins
22
         */
23
        if ($container->hasParameter('db_config_loaded')) {
24
            $container->get('majima.plugins')->registerPlugins($container);
25
            $container->setParameter('plugins.view.dirs', $container->get('majima.plugins')->getViewResources());
26
            $container->setParameter('plugins.css.files', $container->get('majima.plugins')->getCssResources());
27
            $container->setParameter('plugins.js.files', $container->get('majima.plugins')->getJsResources());
28
        } else {
29
            $container->setParameter('majima.plugin.routes', []);
30
        }
31
    }
32
}