Container::has()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 1
crap 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