Completed
Push — master ( a9d145...300265 )
by Rougin
13:04 queued 10:48
created

InteropContainer::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Zapheus\Bridge\Psr;
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 Royce Gutib <[email protected]>
13
 */
14
class InteropContainer extends AbstractContainer implements PsrContainerInterface
15
{
16
    /**
17
     * @var \Zapheus\Container\ContainerInterface
18
     */
19
    protected $container;
20
21
    /**
22
     * Initializes the container instance.
23
     *
24
     * @param \Zapheus\Container\ContainerInterface $container
25
     */
26 6
    public function __construct(ContainerInterface $container)
27
    {
28 6
        $this->container = $container;
29 6
    }
30
31
    /**
32
     * Calls methods from \Zapheus\Container\Container.
33
     *
34
     * @param  string $method
35
     * @param  mixed  $parameters
36
     * @return mixed
37
     */
38 6
    public function __call($method, $parameters)
39
    {
40 6
        $instance = array($this->container, $method);
41
42 6
        return call_user_func_array($instance, $parameters);
43
    }
44
}
45