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

DebugApiProvider::getDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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