ContainerHelperTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 34
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setFactory() 0 5 1
A getFactory() 0 4 1
1
<?php
2
/**
3
 * Phossa Project
4
 *
5
 * PHP version 5.4
6
 *
7
 * @category  Library
8
 * @package   Phossa2\Di
9
 * @copyright Copyright (c) 2016 phossa.com
10
 * @license   http://mit-license.org/ MIT License
11
 * @link      http://www.phossa.com/
12
 */
13
/*# declare(strict_types=1); */
14
15
namespace Phossa2\Di\Traits;
16
17
use Phossa2\Di\Interfaces\FactoryInterface;
18
19
/**
20
 * ContainerHelperTrait
21
 *
22
 * @package Phossa2\Di
23
 * @author  Hong Zhang <[email protected]>
24
 * @version 2.0.0
25
 * @since   2.0.0 added
26
 */
27
trait ContainerHelperTrait
28
{
29
    use ResolverAwareTrait;
30
31
    /**
32
     * @var    FactoryInterface
33
     * @access protected
34
     */
35
    protected $factory;
36
37
    /**
38
     * Inject the Factory
39
     *
40
     * @param  FactoryInterface $factory
41
     * @return $this
42
     * @access protected
43
     */
44
    protected function setFactory(FactoryInterface $factory)
45
    {
46
        $this->factory = $factory;
47
        return $this;
48
    }
49
50
    /**
51
     * Get the Factory
52
     *
53
     * @return FactoryInterface
54
     * @access protected
55
     */
56
    protected function getFactory()/*# : FactoryInterface */
57
    {
58
        return $this->factory;
59
    }
60
}
61