Completed
Push — master ( 0ef921...49b538 )
by Martijn
03:08
created

getLoader()   B

Complexity

Conditions 5
Paths 9

Size

Total Lines 29
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 17
nc 9
nop 0
dl 0
loc 29
rs 8.439
c 0
b 0
f 0
1
<?php
2
3
// autoload_real.php @generated by Composer
4
5
class ComposerAutoloaderInitc60d5758fa9d58adc4deb0c77d595b20
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
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('ComposerAutoloaderInitc60d5758fa9d58adc4deb0c77d595b20', 'loadClassLoader'), true, true);
23
        self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
        spl_autoload_unregister(array('ComposerAutoloaderInitc60d5758fa9d58adc4deb0c77d595b20', 'loadClassLoader'));
25
26
        $map = require __DIR__ . '/autoload_namespaces.php';
27
        foreach ($map as $namespace => $path) {
28
            $loader->set($namespace, $path);
29
        }
30
31
        $map = require __DIR__ . '/autoload_psr4.php';
32
        foreach ($map as $namespace => $path) {
33
            $loader->setPsr4($namespace, $path);
34
        }
35
36
        $classMap = require __DIR__ . '/autoload_classmap.php';
37
        if ($classMap) {
38
            $loader->addClassMap($classMap);
39
        }
40
41
        $loader->register(true);
42
43
        return $loader;
44
    }
45
}
46