| Total Complexity | 6 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class IdentityMap |
||
| 10 | { |
||
| 11 | private static array $data = []; |
||
| 12 | |||
| 13 | 3 | public static function contains(int $id, string $className): bool |
|
| 14 | { |
||
| 15 | 3 | if (!\array_key_exists($className, self::$data)) { |
|
| 16 | 1 | return false; |
|
| 17 | } |
||
| 18 | |||
| 19 | 2 | if (!\array_key_exists($id, self::$data[$className])) { |
|
| 20 | 2 | return false; |
|
| 21 | } |
||
| 22 | |||
| 23 | 2 | return true; |
|
| 24 | } |
||
| 25 | |||
| 26 | 3 | public static function get(int $id, string $className): ?DomainObject |
|
| 33 | } |
||
| 34 | |||
| 35 | 3 | public static function set(DomainObject $object): void |
|
| 38 | 3 | } |
|
| 39 | } |
||
| 40 |