Passed
Push — master ( 265c4a...f3df85 )
by Marcel
02:04
created

ComposerAutoloaderInit524e760e56b0620cb9bc3d8d9ad8543d::getLoader()   B

Complexity

Conditions 11
Paths 61

Size

Total Lines 46
Code Lines 28

Duplication

Lines 0
Ratio 0 %

Importance

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

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 ComposerAutoloaderInit524e760e56b0620cb9bc3d8d9ad8543d
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
    public static function getLoader()
17
    {
18
        if (null !== self::$loader) {
19
            return self::$loader;
20
        }
21
22
        spl_autoload_register(array('ComposerAutoloaderInit524e760e56b0620cb9bc3d8d9ad8543d', 'loadClassLoader'), true, true);
23
        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
        spl_autoload_unregister(array('ComposerAutoloaderInit524e760e56b0620cb9bc3d8d9ad8543d', 'loadClassLoader'));
25
26
        $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
27
        if ($useStaticLoader) {
28
            require_once __DIR__ . '/autoload_static.php';
29
30
            call_user_func(\Composer\Autoload\ComposerStaticInit524e760e56b0620cb9bc3d8d9ad8543d::getInitializer($loader));
31
        } else {
32
            $map = require __DIR__ . '/autoload_psr4.php';
33
            foreach ($map as $namespace => $path) {
34
                $loader->setPsr4($namespace, $path);
35
            }
36
37
            $classMap = require __DIR__ . '/autoload_classmap.php';
38
            if ($classMap) {
39
                $loader->addClassMap($classMap);
40
            }
41
        }
42
43
        $loader->register(true);
44
45
        if ($useStaticLoader) {
46
            $includeFiles = Composer\Autoload\ComposerStaticInit524e760e56b0620cb9bc3d8d9ad8543d::$files;
47
        } else {
48
            $includeFiles = require __DIR__ . '/autoload_files.php';
49
        }
50
        foreach ($includeFiles as $fileIdentifier => $file) {
51
            composerRequire524e760e56b0620cb9bc3d8d9ad8543d($fileIdentifier, $file);
52
        }
53
54
        return $loader;
55
    }
56
}
57
58
function composerRequire524e760e56b0620cb9bc3d8d9ad8543d($fileIdentifier, $file)
59
{
60
    if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
61
        require $file;
62
63
        $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
64
    }
65
}
66