ContainerAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 40%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContainer() 0 4 1
A setContainer() 0 6 1
1
<?php declare(strict_types=1);
2
3
namespace League\Route;
4
5
use Psr\Container\ContainerInterface;
6
7
trait ContainerAwareTrait
8
{
9
    /**
10
     * @var \Psr\Container\ContainerInterface
11
     */
12
    protected $container;
13
14
    /**
15
     * Get container.
16
     *
17
     * @return \Psr\Container\ContainerInterface
18
     */
19 16
    public function getContainer() : ?ContainerInterface
20
    {
21 16
        return $this->container;
22
    }
23
24
    /**
25
     * Set container.
26
     *
27
     * @param \Psr\Container\ContainerInterface $container
28
     *
29
     * @return \League\Route\ContainerAwareInterface
30
     */
31
    public function setContainer(ContainerInterface $container) : ContainerAwareInterface
32
    {
33
        $this->container = $container;
34
35
        return $this;
36
    }
37
}
38