Conditions | 6 |
Paths | 5 |
Total Lines | 20 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 42 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
18 | public function getSuites(string $folder): array |
||
19 | { |
||
20 | $suites = []; |
||
21 | $folder = (string) realpath($folder); |
||
22 | $classMap = require \findVendorDirectory() . "/composer/autoload_classmap.php"; |
||
23 | foreach ($classMap as $class => $file) { |
||
24 | $file = (string) realpath($file); |
||
25 | if (!str_starts_with($file, $folder)) { |
||
26 | continue; |
||
27 | } |
||
28 | try { |
||
29 | $reflection = new ReflectionClass($class); |
||
30 | } catch (ReflectionException $e) { |
||
31 | continue; |
||
32 | } |
||
33 | if (!$reflection->isAbstract() && $reflection->isSubclassOf(TestCase::class)) { |
||
34 | $suites[] = $reflection->getName(); |
||
35 | } |
||
36 | } |
||
37 | return $suites; |
||
38 | } |
||
40 |