ContainerAwareTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
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 25
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|null
11
     */
12
    protected $container;
13
14
    /**
15
     * {@inheritdoc}
16
     */
17 22
    public function getContainer() : ?ContainerInterface
18
    {
19 22
        return $this->container;
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function setContainer(ContainerInterface $container) : ContainerAwareInterface
26
    {
27
        $this->container = $container;
28
29
        return $this;
30
    }
31
}
32