Completed
Push — master ( 1ac25e...0210cc )
by Woody
14s
created

ContainerConfig::apply()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 11
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Northwoods\Container\Config;
4
5
use Auryn\Injector;
6
use Northwoods\Container\InjectorConfig;
7
use Northwoods\Container\InjectorContainer;
8
use Psr\Container\ContainerInterface;
9
10
class ContainerConfig implements InjectorConfig
11
{
12 1
    public function apply(Injector $injector)
13
    {
14
        // Optional: Declare a single container instance.
15 1
        $injector->share(ContainerInterface::class);
16
17
        // Use InjectorContainer as the implementation of ContainerInterface.
18 1
        $injector->alias(ContainerInterface::class, InjectorContainer::class);
19
20
        // InjectorContainer will wrap this Injector instance.
21 1
        $injector->define(InjectorContainer::class, [':injector' => $injector]);
22 1
    }
23
}
24