getConcrete()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 7
ccs 0
cts 4
cp 0
rs 10
cc 2
nc 2
nop 1
crap 6
1
<?php
2
3
if( ! function_exists("app") ){
4
    function app($alias = null){
5 120
        static $app = null;
6
7 120
        if( $app == null ){
8
            $app = new \ProyectoTAU\TAU\Common\ContainerExt();
9
        }
10
11 120
        if( $alias != null )
12 76
            return $app->get($alias);
13
14 120
        return $app;
15
    }
16
17
    if( ! function_exists("getConcrete") ) {
18
        function getConcrete($entityManager): \ProyectoTAU\TAU\Common\Repository
19
        {
20
            $em_class = strstr($entityManager, '::', true);
21
            if ($em_class === false) {
22
                return new $entityManager;
23
            } else {
24
                return call_user_func(array($em_class, 'getInstance'));
25
            }
26
        }
27
    }
28
}
29