Completed
Push — master ( 8e1449...c61dd9 )
by Thierry
01:56
created

ContainerTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A diGet() 0 4 1
1
<?php
2
3
/**
4
 * ContainerTrait.php - Trait for dependency injection
5
 *
6
 * @package jaxon-core
7
 * @author Thierry Feuzeu <[email protected]>
8
 * @copyright 2016 Thierry Feuzeu <[email protected]>
9
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
10
 * @link https://github.com/jaxon-php/jaxon-core
11
 */
12
13
namespace Jaxon\DI;
14
15
trait ContainerTrait
16
{
17
    /**
18
     * Get a class instance
19
     *
20
     * @param string                $sClass             A full class name
21
     *
22
     * @return object               The class instance
23
     */
24
    public function diGet($sClass)
25
    {
26
        return Container::getInstance()->get($sClass);
27
    }
28
}
29