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

InteropContainer   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 31
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A __call() 0 6 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