| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | public function provideMimeTypes(): array |
||
| 10 | { |
||
| 11 | $result = []; |
||
| 12 | $aggregated = (string) @file_get_contents('https://raw.githubusercontent.com/jshttp/mime-db/master/db.json'); |
||
| 13 | |||
| 14 | foreach (json_decode($aggregated, true) as $mimeType => $information) { |
||
| 15 | /** @var string[] $extensions */ |
||
| 16 | $extensions = $information['extensions'] ?? []; |
||
| 17 | |||
| 18 | foreach ($extensions as $extension) { |
||
| 19 | $result[] = new MimeTypeForExtension($mimeType, $extension); |
||
| 20 | } |
||
| 21 | } |
||
| 22 | |||
| 23 | return $result; |
||
| 24 | } |
||
| 26 |