| Total Complexity | 9 |
| Total Lines | 53 |
| Duplicated Lines | 0 % |
| Coverage | 83.33% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 14 | trait TCheckCalls |
||
| 15 | { |
||
| 16 | use TLang; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @throws MimeException |
||
| 20 | */ |
||
| 21 | 4 | public function checkMimeClass(): void |
|
| 26 | } |
||
| 27 | // @codeCoverageIgnoreEnd |
||
| 28 | 4 | } |
|
| 29 | |||
| 30 | 4 | public function isMimeClass(): bool |
|
| 31 | { |
||
| 32 | 4 | return class_exists('\finfo'); |
|
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @throws MimeException |
||
| 37 | */ |
||
| 38 | 6 | public function checkMimeMethod(): void |
|
| 43 | } |
||
| 44 | // @codeCoverageIgnoreEnd |
||
| 45 | 6 | } |
|
| 46 | |||
| 47 | 11 | public function isMimeMethod(): bool |
|
| 48 | { |
||
| 49 | 11 | return method_exists('\finfo', 'buffer'); |
|
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @throws MimeException |
||
| 54 | */ |
||
| 55 | 13 | public function checkMimeFunction(): void |
|
| 56 | { |
||
| 57 | 13 | if (!$this->isMimeFunction()) { |
|
| 58 | // @codeCoverageIgnoreStart |
||
| 59 | throw new MimeException($this->getMiLang()->miNoFunction()); |
||
| 60 | } |
||
| 61 | // @codeCoverageIgnoreEnd |
||
| 62 | 13 | } |
|
| 63 | |||
| 64 | 25 | protected function isMimeFunction(): bool |
|
| 67 | } |
||
| 68 | } |
||
| 69 |