Conditions | 3 |
Paths | 4 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
37 | 12 | public static function encrypt($searchable, int $part = null): string |
|
38 | { |
||
39 | 12 | $scoutKey = method_exists($searchable, 'getScoutKey') ? $searchable->getScoutKey() : $searchable->getKey(); |
|
40 | |||
41 | 12 | $meta = [get_class($searchable->getModel()), $scoutKey]; |
|
42 | |||
43 | 12 | if ($part !== null) { |
|
44 | 4 | $meta[] = $part; |
|
45 | } |
||
46 | |||
47 | 12 | return implode(self::$separator, $meta); |
|
48 | } |
||
70 |