anonymous()
last analyzed

Size

Total Lines 16
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 10
nc 3
nop 0
dl 0
loc 16
c 0
b 0
f 0
1
<?php
2
3
// Init composer autoload
4
call_user_func(function () {
5
    $candidates = [
6
        // module in vendor
7
        __DIR__ . '/../../../../autoload.php',
8
        // module itself is webroot (usually during CI installs)
9
        __DIR__ . '/../../vendor/autoload.php',
10
        // fallback
11
        getcwd() . '/vendor/autoload.php',
12
    ];
13
    foreach ($candidates as $candidate) {
14
        if (file_exists($candidate)) {
15
            require_once $candidate;
16
            return;
17
        }
18
    }
19
    die("Failed to include composer's autoloader, unable to continue");
0 ignored issues
show
Best Practice introduced by
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
20
});
21