Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | private function getContentsAsArray(string $path): array |
||
35 | { |
||
36 | $fileExtension = pathinfo($path)['extension']; |
||
37 | |||
38 | foreach ($this->fileParsers as $fileParser) { |
||
39 | if ($fileParser->supportsFileExtension($fileExtension)) { |
||
40 | return $fileParser->getFileContentsAsArray($path); |
||
41 | } |
||
42 | } |
||
43 | |||
44 | throw FileFormatNotSupported::constructFromPath($path); |
||
45 | } |
||
46 | |||
54 |