GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Bootstrap::init()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace HtpasswdManager;
4
5
use Zend\Loader\AutoloaderFactory;
6
use RuntimeException;
7
8
/**
9
 * Test bootstrap, for setting up autoloading
10
 */
11
class Bootstrap {
12
    protected static $serviceManager;
13
14
    public static function init() {
15
        static::initAutoloader();
16
    }
17
18
    protected static function initAutoloader() {
19
        $vendorPath = static::findParentPath('vendor');
20
21
        if (file_exists($vendorPath . '/autoload.php')) {
22
            include $vendorPath . '/autoload.php';
23
        }
24
25
        if (!class_exists('Zend\Loader\AutoloaderFactory')) {
26
            throw new RuntimeException(
27
                'Unable to load ZF2. Run `php composer.phar install`'
28
            );
29
        }
30
31
        AutoloaderFactory::factory(array(
32
            'Zend\Loader\StandardAutoloader' => array(
33
                'autoregister_zf' => true,
34
                'namespaces'      => array(
35
                    __NAMESPACE__ => __DIR__ . '/' . __NAMESPACE__,
36
                ),
37
            ),
38
        ));
39
    }
40
41
    protected static function findParentPath($path) {
42
        $dir         = __DIR__;
43
        $previousDir = '.';
44
        while (!is_dir($dir . '/' . $path)) {
45
            $dir = dirname($dir);
46
            if ($previousDir === $dir) {
47
                return false;
48
            }
49
            $previousDir = $dir;
50
        }
51
52
        return $dir . '/' . $path;
53
    }
54
}
55
56
Bootstrap::init();