Completed
Push — master ( be1dc2...d56e9e )
by Vitaly
06:38
created

global.php ➔ db()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 3
eloc 5
c 1
b 0
f 1
nc 2
nop 1
dl 0
loc 11
rs 9.4285
1
<?php declare(strict_types = 1);
2
/**
3
 * @deprecated Use dependency injection or generated class
4
 */
5
function db($link_id = null)
0 ignored issues
show
Unused Code introduced by
The parameter $link_id is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
6
{
7
    static $_db;
8
9
    // Get from new container
10
    if (array_key_exists('__core', $GLOBALS) && $_db === null) {
11
        $_db = $GLOBALS['__core']->getContainer()->getDatabase();
12
    }
13
14
    return $_db;
15
}
16