Passed
Pull Request — master (#12)
by Korotkov
01:40
created

SetContainerTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A container() 0 3 1
A __construct() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * @author    : Korotkov Danila <[email protected]>
7
 * @copyright Copyright (c) 2018, Korotkov Danila
8
 * @license   http://www.gnu.org/licenses/gpl.html GNU GPLv3.0
9
 */
10
11
namespace Rudra\ExternalTraits;
12
13
use Rudra\Interfaces\ContainerInterface;
14
15
/**
16
 * Trait SetContainerTrait
17
 * @package Rudra\ExternalTraits
18
 */
19
trait SetContainerTrait
20
{
21
22
    /**
23
     * @var ContainerInterface
24
     */
25
    protected $container;
26
27
    /**
28
     * SetContainerTrait constructor.
29
     * @param ContainerInterface $container
30
     */
31
    public function __construct(ContainerInterface $container)
32
    {
33
        $this->container = $container;
34
    }
35
36
    /**
37
     * @return ContainerInterface
38
     */
39
    public function container(): ContainerInterface
40
    {
41
        return $this->container;
42
    }
43
}
44