Passed
Pull Request — master (#346)
by huang
43:36 queued 18:42
created

classLoader()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 7
ccs 0
cts 4
cp 0
crap 6
rs 10
c 1
b 1
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