Passed
Pull Request — master (#105)
by Evgeniy
08:08 queued 04:03
created

Implementation   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 7 2
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cekta\DI\Container;
6
7
use Psr\Container\ContainerInterface;
8
9
class Implementation extends KeyValue
10
{
11
    /**
12
     * @var ContainerInterface
13
     */
14
    private $container;
15
16 6
    public function __construct(array $values, ContainerInterface $container)
17
    {
18 6
        parent::__construct($values);
19 6
        $this->container = $container;
20 6
    }
21
22 3
    public function get($id)
23
    {
24 3
        $result = parent::get($id);
25 3
        if (is_string($result)) {
26 3
            $result = $this->container->get($result);
27
        }
28 3
        return $result;
29
    }
30
}
31