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.
Completed
Push — master ( b5e289...293ae4 )
by Emil
02:28
created

autoloader.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/**
3
 * An example of a project-specific implementation.
4
 * 
5
 * After registering this autoload function with SPL, the following line
6
 * would cause the function to attempt to load the \Foo\Bar\Baz\Qux class
7
 * from /path/to/project/src/Baz/Qux.php:
8
 * 
9
 *      new \Foo\Bar\Baz\Qux;
10
 *      
11
 * @param string $class The fully-qualified class name.
12
 * @return void
13
 */
14
spl_autoload_register(function ($class) {
15
16
    // project-specific namespace prefix
17
    //$prefix = 'Foo\\Bar\\';
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
18 1
    $prefix = 'Scelus\\';
19
20
    // base directory for the namespace prefix
21 1
    $base_dir = __DIR__ . '/src/';
22
23
    // does the class use the namespace prefix?
24 1
    $len = strlen($prefix);
25 1
    if (strncmp($prefix, $class, $len) !== 0) {
26
        // no, move to the next registered autoloader
27
        return;
28
    }
29
30
    // get the relative class name
31 1
    $relative_class = substr($class, $len);
32
33
    // replace the namespace prefix with the base directory, replace namespace
34
    // separators with directory separators in the relative class name, append
35
    // with .php
36 1
    $file = $base_dir . str_replace('\\', '/', $relative_class) . '.php';
37
38
    // if the file exists, require it
39 1
    if (file_exists($file)) {
40 1
        require $file;
41
    }
42
});