ContainerAwareMethods   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
dl 0
loc 29
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getContainer() 0 3 1
A setContainer() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of slick/di
5
 *
6
 * For the full copyright and license information, please view the LICENSE.md
7
 * file that was distributed with this source code.
8
 */
9
10
namespace Slick\Di;
11
12
/**
13
 * Implementation methods for ContainerAwareInterface
14
 *
15
 * @package Slick\Di
16
 * @author  Filipe Silva <[email protected]>
17
 */
18
trait ContainerAwareMethods
19
{
20
21
    /**
22
     * @var ContainerInterface
23
     */
24
    protected $container;
25
26
    /**
27
     * Get container
28
     *
29
     * @return ContainerInterface
30
     */
31
    public function getContainer(): ContainerInterface
32
    {
33
        return $this->container;
34
    }
35
36
    /**
37
     * Set container
38
     *
39
     * @param ContainerInterface $container
40
     *
41
     * @return self|$this|ContainerAwareMethods
42
     */
43
    public function setContainer(ContainerInterface $container): self
44
    {
45
        $this->container = $container;
46
        return $this;
47
    }
48
}
49