global.php ➔ db()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 11
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
eloc 5
nc 2
nop 1
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
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()->get('database');
12
    }
13
14
    return $_db;
15
}
16