| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 4.125 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 37 | 1 | public function __invoke($input) |
|
| 38 | { |
||
| 39 | 1 | if (function_exists('mb_convert_encoding')) { |
|
| 40 | 1 | return mb_convert_encoding($input, $this->charset, $this->inCharset); |
|
| 41 | } |
||
| 42 | |||
| 43 | if (function_exists('iconv')) { |
||
| 44 | return iconv($this->inCharset, $this->charset, $input); |
||
| 45 | } |
||
| 46 | |||
| 47 | throw new \RuntimeException('Could not convert the charset. Please install the mbstring or iconv extension!'); |
||
| 48 | } |
||
| 49 | } |
||
| 50 |