Passed
Push — master ( 1ffb2d...f18857 )
by Dmitriy
05:56 queued 02:52
created

DebugApiProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getDefinitions() 0 3 1
A getExtensions() 0 6 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Yiisoft\Yii\Debug\Api\Debug\Provider;
6
7
use Psr\Container\ContainerInterface;
8
use Yiisoft\Di\ServiceProviderInterface;
9
use Yiisoft\Router\RouteCollectorInterface;
10
use Yiisoft\Yii\Debug\Api\Debug\Middleware\DebugHeaders;
11
12
final class DebugApiProvider implements ServiceProviderInterface
13
{
14
    /**
15
     * @psalm-suppress InaccessibleMethod
16
     */
17
    public function getDefinitions(): array
18
    {
19
        return [];
20
    }
21
22
    public function getExtensions(): array
23
    {
24
        return [
25
            RouteCollectorInterface::class => static function (ContainerInterface $container, RouteCollectorInterface $routeCollector) {
26
                $routeCollector->prependMiddleware(DebugHeaders::class);
27
                return $routeCollector;
28
            },
29
        ];
30
    }
31
}
32