| Conditions | 4 |
| Paths | 6 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public static function DaftObjectIdValuesHash(array $id) : string |
||
| 31 | { |
||
| 32 | static $ids = []; |
||
| 33 | |||
| 34 | $className = static::class; |
||
| 35 | |||
| 36 | $objectIds = ''; |
||
| 37 | foreach (array_values($id) as $i => $idVal) { |
||
| 38 | if ($i >= 1) { |
||
| 39 | $objectIds .= '::'; |
||
| 40 | } |
||
| 41 | $objectIds .= (string) $idVal; |
||
| 42 | } |
||
| 43 | |||
| 44 | if (false === isset($ids[$className], $ids[$className][$objectIds])) { |
||
| 45 | $ids[$className] = $ids[$className] ?? []; |
||
| 46 | $ids[$className][$objectIds] = (string) count($ids[$className]); |
||
| 47 | } |
||
| 48 | |||
| 49 | return $ids[$className][$objectIds]; |
||
| 50 | } |
||
| 52 |