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

ManagerFactoryPass::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 7
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
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