Completed
Pull Request — master (#656)
by
unknown
02:22
created

ManagerFactoryPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 0
cbo 3
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 7 2
1
<?php
2
/*
3
* This file is part of the ONGR package.
4
*
5
* (c) NFQ Technologies UAB <[email protected]>
6
*
7
* For the full copyright and license information, please view the LICENSE
8
* file that was distributed with this source code.
9
*/
10
11
namespace ONGR\ElasticsearchBundle\DependencyInjection\Compiler;
12
13
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
14
use Symfony\Component\DependencyInjection\ContainerBuilder;
15
use Symfony\Component\DependencyInjection\Reference;
16
17
/**
18
 * Compiles elastic search data.
19
 */
20
class ManagerFactoryPass implements CompilerPassInterface
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function process(ContainerBuilder $container)
26
    {
27
        $definition = $container->getDefinition('es.manager_factory');
28
        if ($container->hasDefinition('debug.stopwatch')) {
29
            $definition->addMethodCall('setStopwatch', [new Reference('debug.stopwatch')]);
30
        }
31
    }
32
}
33