Completed
Push — master ( d7bbda...0e324f )
by Kamil
06:08
created

ContainerBasedContainerAccessor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 2
dl 0
loc 31
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getService() 0 4 1
A getParameters() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the CrossContainerExtension package.
5
 *
6
 * (c) Kamil Kokot <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FriendsOfBehat\CrossContainerExtension;
13
14
use Symfony\Component\DependencyInjection\Container;
15
16
final class ContainerBasedContainerAccessor implements ContainerAccessor
17
{
18
    /**
19
     * @var Container
20
     */
21
    private $container;
22
23
    /**
24
     * @param Container $container
25
     */
26
    public function __construct(Container $container)
27
    {
28
        $this->container = $container;
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    public function getService($id)
35
    {
36
        return $this->container->get($id);
37
    }
38
39
    /**
40
     * {@inheritdoc}
41
     */
42
    public function getParameters()
43
    {
44
        return $this->container->getParameterBag()->all();
45
    }
46
}
47