Passed
Push — master ( f26f03...fd642f )
by Derek Stephen
05:54
created

DebugBarPackage   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 6
c 1
b 0
f 0
dl 0
loc 18
ccs 1
cts 1
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A addViews() 0 3 1
A addViewExtensions() 0 6 1
A addToContainer() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Bone\DebugBar;
6
7
use Barnacle\Container;
8
use Bone\Contracts\Container\ContainerInterface;
9
use Bone\Contracts\Container\RegistrationInterface;
10
use Bone\DebugBar\View\Extension\DebugBarExtension;
0 ignored issues
show
Bug introduced by
The type Bone\DebugBar\View\Extension\DebugBarExtension was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
11
use Bone\View\ViewEngineInterface;
12 1
use Bone\View\ViewRegistrationInterface;
13
14 1
class DebugBarPackage implements RegistrationInterface, ViewRegistrationInterface
15
{
16
    public function addToContainer(ContainerInterface $c): void
17
    {
18
        $c[DebugBar::class] = new DebugBar();
19
    }
20
21
    public function addViews(): array
22
    {
23
        return [];
24
    }
25
26
    public function addViewExtensions(Container $c): array
27
    {
28
        $debugBar = $c->get(DebugBar::class);
29
        $viewEngine = $c->get(ViewEngineInterface::class);
30
31
        return [new DebugBarExtension($viewEngine, $debugBar)];
32
    }
33
}
34