Completed
Push — master ( bea38d...ad9e91 )
by Thierry
03:27
created

DI   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
 * DI.php - Trait for dependency injection
5
 *
6
 * Define closures for instanciating classes, and return class instances.
7
 *
8
 * @package jaxon-core
9
 * @author Thierry Feuzeu <[email protected]>
10
 * @copyright 2016 Thierry Feuzeu <[email protected]>
11
 * @license https://opensource.org/licenses/BSD-3-Clause BSD 3-Clause License
12
 * @link https://github.com/jaxon-php/jaxon-core
13
 */
14
15
namespace Jaxon\Utils\Traits;
16
17
use Jaxon\Utils\Container;
18
19
trait DI
20
{
21
    /**
22
     * Get a class instance
23
     *
24
     * @param string                $sClass             A full class name
25
     *
26
     * @return object               The class instance
27
     */
28
    public function diGet($sClass)
29
    {
30
        return Container::getInstance()->get($sClass);
31
    }
32
}
33