| Conditions | 2 |
| Paths | 3 |
| Total Lines | 9 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | 3 | public function getMime(array $path): string |
|
| 23 | { |
||
| 24 | 3 | $this->checkMimeClass(); |
|
| 25 | 3 | $this->checkMimeFunction(); |
|
| 26 | try { |
||
| 27 | 3 | $fileinfo = new \finfo(\FILEINFO_MIME); // file mimetype |
|
| 28 | 3 | return $this->determineResult($fileinfo->buffer($this->pathOnVolume($path))); |
|
| 29 | 1 | } catch (PathsException $ex) { |
|
| 30 | 1 | throw new MimeException($ex->getMessage(), $ex->getCode(), $ex); |
|
| 31 | } |
||
| 34 |