Completed
Pull Request — master (#346)
by huang
21:21
created

autoload.php ➔ classLoader()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 9
ccs 0
cts 6
cp 0
crap 6
rs 9.9666
c 0
b 0
f 0
1
<?php
2
3
function classLoader($class)
4
{
5
    $path = str_replace('\\', DIRECTORY_SEPARATOR, $class);
6
    $file = __DIR__ . '/src/' . $path . '.php';
7
8
    if (file_exists($file)) {
9
        require_once $file;
10
    }
11
}
12
spl_autoload_register('classLoader');
13
14
require_once  __DIR__ . '/src/Qiniu/functions.php';
15