Completed
Pull Request — master (#1739)
by
unknown
14:00 queued 04:06
created

AsyncHandlerPass   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 17
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 11 2
1
<?php
2
3
/*
4
 * This file is part of the FOSElasticaBundle package.
5
 *
6
 * (c) FriendsOfSymfony <https://friendsofsymfony.github.com/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\ElasticaBundle\DependencyInjection\Compiler;
13
14
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15
use Symfony\Component\DependencyInjection\ContainerBuilder;
16
17
class AsyncHandlerPass implements CompilerPassInterface
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function process(ContainerBuilder $container)
23
    {
24
        if (!$container->hasDefinition('fos_elastica.async_parsist_page_handler')) {
25
            return;
26
        }
27
28
        $messageBus = $container->getParameter('message_bus') ?? 'messenger.default_bus';
29
30
        $container->getDefinition('fos_elastica.async_parsist_page_handler')
31
            ->addTag('messenger.message_handler', ['bus' => $messageBus]);
32
    }
33
}
34