SlugifyPass::process()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 16
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 16
rs 9.4285
cc 2
eloc 8
nc 2
nop 1
1
<?php
2
3
namespace DoS\ResourceBundle\DependencyInjection\Compiler;
4
5
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
6
use Symfony\Component\DependencyInjection\ContainerBuilder;
7
8
class SlugifyPass implements CompilerPassInterface
9
{
10
    /**
11
     * {@inheritdoc}
12
     */
13
    public function process(ContainerBuilder $container)
14
    {
15
        if (!$container->hasDefinition('cocur_slugify')) {
16
            return;
17
        }
18
19
        $definition = $container->getDefinition('cocur_slugify');
20
21
        $definition->addMethodCall('setRegExp', array(
22
            $container->getParameter('dos.slugify.reg_exp')
23
        ));
24
25
        $definition->addMethodCall('setOptions', array(
26
            array('lowercase' => $container->getParameter('dos.slugify.lowercase'))
27
        ));
28
    }
29
}
30