Conditions | 3 |
Paths | 4 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
19 | public function parse(): AbstractVariable |
||
20 | { |
||
21 | $path = File::path($this->unparsed); |
||
22 | |||
23 | $files = @scandir($path) ?: []; |
||
24 | |||
25 | unset($files[0], $files[1]); |
||
26 | |||
27 | $this->parsed = []; |
||
28 | |||
29 | foreach ($files as $file) { |
||
30 | $id = pathinfo($file, PATHINFO_FILENAME); |
||
31 | |||
32 | $filePath = $path . $file; |
||
33 | |||
34 | $this->parsed[$id] = [ |
||
35 | 'id' => $id, |
||
36 | 'content' => $this->parser->parse($filePath), |
||
37 | ]; |
||
38 | } |
||
39 | |||
40 | return $this; |
||
41 | } |
||
42 | } |
||
43 |