ContainerAwareMethods::getContainer()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
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