| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 56 | 9 | public function getTypes($strict = true) |
|
| 57 | { |
||
| 58 | 9 | $map = new MapHandler(); |
|
| 59 | 9 | if (!isset($map->get()['extensions'][$this->extension])) { |
|
| 60 | 5 | if ($strict) { |
|
| 61 | 2 | throw new MappingException('No MIME type mapped to extension ' . $this->extension); |
|
| 62 | } else { |
||
| 63 | 3 | return ['application/octet-stream']; |
|
| 64 | } |
||
| 65 | } |
||
| 66 | 5 | return $map->get()['extensions'][$this->extension]; |
|
| 67 | } |
||
| 68 | } |
||
| 69 |