Completed
Push — master ( d0dcc2...a5c417 )
by Andy
01:36
created

ContainerAwareTrait::get()   A

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 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Palmtree\Container;
4
5
trait ContainerAwareTrait
6
{
7
    /** @var Container $container */
8
    protected $container;
9
10 3
    protected function setContainer(Container $container)
11
    {
12 3
        $this->container = $container;
13 3
    }
14
15
    /**
16
     * @return Container
17
     */
18 1
    public function getContainer()
19
    {
20 1
        return $this->container;
21
    }
22
23
    /**
24
     * @param string $key
25
     * @return mixed
26
     */
27 1
    public function get($key)
28
    {
29 1
        return $this->container->get($key);
30
    }
31
32
    /**
33
     * @param string $key
34
     * @param mixed  $default
35
     * @return mixed
36
     */
37 1
    public function getParameter($key, $default = null)
38
    {
39 1
        return $this->container->getParameter($key, $default);
40
    }
41
}
42