Container   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
eloc 5
c 2
b 0
f 0
dl 0
loc 37
ccs 7
cts 7
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A get() 0 3 1
A has() 0 3 1
1
<?php
2
3
namespace Zapheus\Bridge\Psr\Zapheus;
4
5
use Psr\Container\ContainerInterface as PsrContainerInterface;
6
use Zapheus\Container\ContainerInterface;
7
8
/**
9
 * Zapheus to PSR-11 Container Bridge
10
 *
11
 * @package Zapheus
12
 * @author  Rougin Gutib <[email protected]>
13
 */
14
class Container implements ContainerInterface
15
{
16
    /**
17
     * @var \Psr\Container\ContainerInterface
18
     */
19
    protected $container;
20
21
    /**
22
     * Initializes the container instance.
23
     *
24
     * @param \Psr\Container\ContainerInterface $container
25
     */
26 6
    public function __construct(PsrContainerInterface $container)
27
    {
28 6
        $this->container = $container;
29 6
    }
30
31
    /**
32
     * Finds an entry of the container by its identifier and returns it.
33
     *
34
     * @param  string $id
35
     * @return mixed
36
     */
37 6
    public function get($id)
38
    {
39 6
        return $this->container->get($id);
40
    }
41
42
    /**
43
     * Returns true if the container can return an entry for the given identifier.
44
     *
45
     * @param  string $id
46
     * @return boolean
47
     */
48 6
    public function has($id)
49
    {
50 6
        return $this->container->has($id);
51
    }
52
}
53