Passed
Push — master ( baa47a...d44c16 )
by Kelvin
02:08
created

getLoader()   B

Complexity

Conditions 11
Paths 61

Size

Total Lines 44
Code Lines 27

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 11
eloc 27
c 1
b 0
f 0
nc 61
nop 0
dl 0
loc 44
rs 7.3166

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
// autoload_real.php @generated by Composer
4
5
class ComposerAutoloaderInit912ef365a6588e1102f28f1b2c039019
6
{
7
    private static $loader;
8
9
    public static function loadClassLoader($class)
10
    {
11
        if ('Composer\Autoload\ClassLoader' === $class) {
12
            require __DIR__ . '/ClassLoader.php';
13
        }
14
    }
15
16
    /**
17
     * @return \Composer\Autoload\ClassLoader
18
     */
19
    public static function getLoader()
20
    {
21
        if (null !== self::$loader) {
22
            return self::$loader;
23
        }
24
25
        require __DIR__ . '/platform_check.php';
26
27
        spl_autoload_register(array('ComposerAutoloaderInit912ef365a6588e1102f28f1b2c039019', 'loadClassLoader'), true, true);
28
        self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
29
        spl_autoload_unregister(array('ComposerAutoloaderInit912ef365a6588e1102f28f1b2c039019', 'loadClassLoader'));
30
31
        require __DIR__ . '/autoload_static.php';
32
        call_user_func(\Composer\Autoload\ComposerStaticInit912ef365a6588e1102f28f1b2c039019::getInitializer($loader));
33
34
        $loader->register(true);
35
36
        $filesToLoad = \Composer\Autoload\ComposerStaticInit912ef365a6588e1102f28f1b2c039019::$files;
37
        $requireFile = static function ($fileIdentifier, $file) {
38
            if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
39
                $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
40
41
                require $file;
42
            }
43
        };
44
        foreach ($filesToLoad as $fileIdentifier => $file) {
45
            ($requireFile)($fileIdentifier, $file);
46
        }
47
48
        return $loader;
49
    }
50
}
51