Conditions | 5 |
Paths | 8 |
Total Lines | 30 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
23 | function getTests(string $path): array |
||
24 | { |
||
25 | $files = []; |
||
26 | // $iterator = new RecursiveDirectoryIterator($path) or die(__FUNCTION__ . ": Failed opening directory {$path} for reading"); |
||
27 | $iterator = new TestCaseFilter(new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path))) or |
||
28 | die(__FUNCTION__ . ": Failed opening directory {$path} for reading"); |
||
|
|||
29 | |||
30 | |||
31 | foreach ($iterator as $file) { |
||
32 | |||
33 | if ($file->isDir() === true) { |
||
34 | continue; |
||
35 | } |
||
36 | |||
37 | // Fout |
||
38 | // |
||
39 | // begin.yml |
||
40 | // replies.yml |
||
41 | // triggers.yml |
||
42 | // test-spec.yml |
||
43 | |||
44 | if ($file->getBasename() !== 'rep.yml') { |
||
45 | // continue; |
||
46 | } |
||
47 | |||
48 | |||
49 | $files[] = $file->getPathname(); |
||
50 | } |
||
51 | |||
52 | return $files; |
||
53 | } |
||
54 |
In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.