ContainerConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A apply() 0 11 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Northwoods\Container\Config;
5
6
use Auryn\Injector;
7
use Northwoods\Container\InjectorConfig;
8
use Northwoods\Container\InjectorContainer;
9
use Psr\Container\ContainerInterface;
10
11
class ContainerConfig implements InjectorConfig
12
{
13 2
    public function apply(Injector $injector): void
14
    {
15
        // Assume that the container will be shared
16 2
        $injector->share(ContainerInterface::class);
17
18
        // Use the injector as the preferred container implementation
19 2
        $injector->alias(ContainerInterface::class, InjectorContainer::class);
20
21
        // The container will wrap this injector
22 2
        $injector->define(InjectorContainer::class, [':injector' => $injector]);
23 2
    }
24
}
25