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.

functions.php ➔ preheat()   A
last analyzed

Complexity

Conditions 4
Paths 4

Size

Total Lines 33

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 18
CRAP Score 4

Importance

Changes 0
Metric Value
cc 4
nc 4
nop 0
dl 0
loc 33
ccs 18
cts 18
cp 1
crap 4
rs 9.392
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace ApiClients\Foundation\ValueObjects;
4
5
use RecursiveDirectoryIterator;
6
use RecursiveIteratorIterator;
7
8
function preheat()
9
{
10 1
    $directory = new RecursiveDirectoryIterator(__DIR__);
11 1
    $directory = new RecursiveIteratorIterator($directory);
12
13 1
    foreach ($directory as $node) {
14 1
        if (!is_file($node->getPathname())) {
15 1
            continue;
16
        }
17
18 1
        $file = substr($node->getPathname(), strlen(__DIR__));
19 1
        $file = ltrim($file, DIRECTORY_SEPARATOR);
20 1
        $file = rtrim($file, '.php');
21
22 1
        if (substr($file, 0, 10) === 'functions') {
23 1
            continue;
24
        }
25
26 1
        $class = __NAMESPACE__ . '\\' . str_replace(DIRECTORY_SEPARATOR, '\\', $file);
27
28
        /** Autoload class */
29 1
        class_exists(
30 1
            $class,
31 1
            true /** yes this true is optional but explicitly marking this as autoloading */
32
        );
33
34
        /** Autoload interface */
35 1
        interface_exists(
36 1
            $class,
37 1
            true /** yes this true is optional but explicitly marking this as autoloading */
38
        );
39
    }
40
}
41