MonologHandlerOverridePass   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 11 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Dziki\MonologSentryBundle\DependencyInjection\Compiler;
6
7
use Dziki\MonologSentryBundle\Handler\Raven;
8
use Monolog\Handler\RavenHandler;
9
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
10
use Symfony\Component\DependencyInjection\ContainerBuilder;
11
use Symfony\Component\DependencyInjection\Definition;
12
13
class MonologHandlerOverridePass implements CompilerPassInterface
14
{
15
    public function process(ContainerBuilder $container): void
16
    {
17
        array_map(
18
            function (Definition $definition) {
19
                if (RavenHandler::class === $definition->getClass()) {
20
                    $definition->setClass(Raven::class);
21
                }
22
            },
23
            $container->getDefinitions()
24
        );
25
    }
26
}
27