ZoredTelegramBundle   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A build() 0 10 1
A getContainerExtension() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Zored\TelegramBundle;
6
7
use Symfony\Component\DependencyInjection\ContainerBuilder;
8
use Symfony\Component\HttpKernel\Bundle\Bundle;
9
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
10
use Zored\Telegram\Bot\Update\UpdateHandlerInterface;
11
use Zored\TelegramBundle\DependencyInjection\ZoredTelegramExtension;
12
use Zored\TelegramBundle\Telegram\Command\BotListener;
13
use Zored\TelegramBundle\Tests\DependencyInjection\CompilerPass\FillArgument;
14
15
class ZoredTelegramBundle extends Bundle
16
{
17
    public function getContainerExtension(): Extension
18
    {
19
        return new ZoredTelegramExtension();
20
    }
21
22
    public function build(ContainerBuilder $container): void
23
    {
24
        $container
25
            ->registerForAutoconfiguration(UpdateHandlerInterface::class)
26
            ->addTag(UpdateHandlerInterface::class)
27
            ;
28
        $container->addCompilerPass(new FillArgument(
29
            BotListener::class,
30
            '$handlers',
31
            UpdateHandlerInterface::class
32
        ));
33
    }
34
}
35