Total Complexity | 5 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | final class ContainerBag implements ContainerBagInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var ContainerInterface |
||
13 | */ |
||
14 | private $container; |
||
15 | |||
16 | /** |
||
17 | * @var InvokerInterface |
||
18 | */ |
||
19 | private $invoker; |
||
20 | |||
21 | 14 | public function __construct(ContainerInterface $container, InvokerInterface $invoker) |
|
22 | { |
||
23 | 14 | $this->container = $container; |
|
24 | 14 | $this->invoker = $invoker; |
|
25 | 14 | } |
|
26 | |||
27 | /** |
||
28 | * @param string $id |
||
29 | * @return mixed |
||
30 | */ |
||
31 | 7 | public function get($id) |
|
34 | } |
||
35 | |||
36 | /** |
||
37 | * @param string $id |
||
38 | * @return bool |
||
39 | */ |
||
40 | 1 | public function has($id): bool |
|
43 | } |
||
44 | |||
45 | /** |
||
46 | * @param callable $callable |
||
47 | * @param array $args |
||
48 | * @return mixed |
||
49 | * @throws Invoker\Exceptions\InvocationException |
||
50 | */ |
||
51 | 1 | public function call(callable $callable, array $args = []) |
|
52 | { |
||
53 | 1 | return $this->invoker->invoke($callable, $args); |
|
54 | } |
||
55 | |||
56 | /** |
||
57 | * @param callable $callable |
||
58 | * @param array $args |
||
59 | * @return array |
||
60 | * @throws Invoker\Exceptions\InvocationException |
||
61 | */ |
||
62 | public function complement(callable $callable, array $args = []): array |
||
65 | } |
||
66 | } |
||
67 |