| Total Complexity | 3 |
| Total Lines | 31 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class Blocks |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var Local[] |
||
| 17 | */ |
||
| 18 | private static $stores = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @param int $id |
||
| 22 | * @return Local |
||
| 23 | */ |
||
| 24 | public static function get(int $id) : ?Local |
||
| 25 | { |
||
| 26 | return self::$stores[$id] ?? null; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @param Local $store |
||
| 31 | * @return Local |
||
| 32 | */ |
||
| 33 | public static function join(Local $store) : Local |
||
| 34 | { |
||
| 35 | return self::$stores[spl_object_id($store)] = $store; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param Local $store |
||
| 40 | */ |
||
| 41 | public static function forget(Local $store) : void |
||
| 44 | } |
||
| 45 | } |
||
| 46 |