| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 4.125 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 16 | 144 | private function normalize($string) |
|
| 17 | { |
||
| 18 | 144 | if (!class_exists('Normalizer')) { |
|
| 19 | if (mb_detect_encoding($string) === 'UTF-8') { |
||
| 20 | throw new \Exception('UTF-8 passphrase is not supported without the PECL intl extension installed.'); |
||
| 21 | } else { |
||
| 22 | return new Buffer($string); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | 144 | return new Buffer(\Normalizer::normalize($string, \Normalizer::FORM_KD)); |
|
| 27 | } |
||
| 28 | |||
| 46 |