Test Failed
Push — master ( 2cc1d9...298910 )
by Alexander
18:21 queued 15:33
created

DebugServiceProvider::getDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 1
cts 1
cp 1
crap 1
rs 10
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