Test Failed
Pull Request — master (#101)
by Rustam
08:56 queued 23s
created

DebugServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 8
Bugs 0 Features 0
Metric Value
eloc 7
c 8
b 0
f 0
dl 0
loc 15
ccs 5
cts 5
cp 1
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefinitions() 0 3 1
A getExtensions() 0 8 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug;
6
7
use Psr\Container\ContainerInterface;
8
use Psr\EventDispatcher\EventDispatcherInterface;
9
use Psr\Log\LoggerInterface;
10
use Yiisoft\Di\Contracts\ServiceProviderInterface;
11
use Yiisoft\Yii\Debug\Collector\EventCollector;
12
use Yiisoft\Yii\Debug\Collector\LogCollector;
13
use Yiisoft\Yii\Debug\Proxy\EventDispatcherInterfaceProxy;
14
use Yiisoft\Yii\Debug\Proxy\LoggerInterfaceProxy;
15
16
final class DebugServiceProvider implements ServiceProviderInterface
17
{
18
    public function getDefinitions(): array
19 1
    {
20
        return [];
21 1
    }
22 1
23
    public function getExtensions(): array
24
    {
25
        return [
26
            LoggerInterface::class => static function (ContainerInterface $container, LoggerInterface $logger) {
27 1
                return new LoggerInterfaceProxy($logger, $container->get(LogCollector::class));
28
            },
29
            EventDispatcherInterface::class => static function (ContainerInterface $container, EventDispatcherInterface $dispatcher) {
30 1
                return new EventDispatcherInterfaceProxy($dispatcher, $container->get(EventCollector::class));
31 1
            },
32 1
        ];
33 1
    }
34
}
35