Passed
Push — main ( f504d0...115cd4 )
by huang
09:25
created

classLoader()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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