Test Failed
Pull Request — master (#100)
by Dmitriy
08:12
created

DebugServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
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 16
ccs 6
cts 6
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
19 1
    public function getDefinitions(): array
20
    {
21 1
        return [];
22 1
    }
23
24
    public function getExtensions(): array
25
    {
26
        return [
27 1
            LoggerInterface::class => static function (ContainerInterface $container, LoggerInterface $logger) {
28
                return new LoggerInterfaceProxy($logger, $container->get(LogCollector::class));
29
            },
30 1
            EventDispatcherInterface::class => static function (ContainerInterface $container, EventDispatcherInterface $dispatcher) {
31 1
                return new EventDispatcherInterfaceProxy($dispatcher, $container->get(EventCollector::class));
32 1
            },
33 1
        ];
34 1
    }
35
}
36