| Conditions | 3 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | 1 | public static function createFromData($data) |
|
| 24 | { |
||
| 25 | 1 | if (\is_array($data) || \is_object($data)) { |
|
| 26 | 1 | $data = serialize($data); |
|
| 27 | } |
||
| 28 | |||
| 29 | 1 | $hash = strtoupper(md5($data)); |
|
| 30 | |||
| 31 | 1 | return implode( |
|
| 32 | 1 | '-', |
|
| 33 | [ |
||
| 34 | 1 | substr($hash, 0, 8), |
|
| 35 | 1 | substr($hash, 8, 4), |
|
| 36 | 1 | substr($hash, 12, 4), |
|
| 37 | 1 | substr($hash, 16, 4), |
|
| 38 | 1 | substr($hash, 20, 8), |
|
| 39 | ] |
||
| 43 |