Conditions | 4 |
Paths | 4 |
Total Lines | 33 |
Lines | 0 |
Ratio | 0 % |
Tests | 18 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
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 |