1 | <?php |
||
26 | final class LockFactory |
||
27 | { |
||
28 | private static $logger; |
||
29 | |||
30 | /** |
||
31 | * @var StoreInterface|null |
||
32 | */ |
||
33 | private static $store; |
||
34 | |||
35 | /** |
||
36 | * @var Factory|null |
||
37 | */ |
||
38 | private static $factory; |
||
39 | |||
40 | /** |
||
41 | * Resets the lock state (including logger, store, and factory) |
||
42 | */ |
||
43 | public static function reset(): void |
||
49 | |||
50 | /** |
||
51 | * @param LoggerInterface|null $logger |
||
52 | */ |
||
53 | public static function setLogger(LoggerInterface $logger = null): void |
||
58 | |||
59 | /** |
||
60 | * @return LoggerInterface |
||
61 | */ |
||
62 | public static function getLogger(): LoggerInterface |
||
66 | |||
67 | /** |
||
68 | * @param StoreInterface|null $store |
||
69 | */ |
||
70 | public static function setStore(StoreInterface $store = null): void |
||
75 | |||
76 | /** |
||
77 | * @return StoreInterface |
||
78 | */ |
||
79 | public static function getStore(): StoreInterface |
||
83 | |||
84 | /** |
||
85 | * @return Factory |
||
86 | */ |
||
87 | public static function getFactory(): Factory |
||
96 | |||
97 | /** |
||
98 | * @param mixed $context |
||
99 | * |
||
100 | * @return null|Lock |
||
101 | */ |
||
102 | public static function create($context): ?Lock |
||
106 | |||
107 | /** |
||
108 | * @param mixed $context |
||
109 | * |
||
110 | * @return null|Lock |
||
111 | */ |
||
112 | public static function acquire($context): ?Lock |
||
118 | |||
119 | /** |
||
120 | * @param mixed $context |
||
121 | * |
||
122 | * @return Lock |
||
123 | */ |
||
124 | public static function blocking($context): Lock |
||
130 | |||
131 | /** |
||
132 | * @param mixed $context |
||
133 | * |
||
134 | * @return string |
||
135 | */ |
||
136 | private static function stringifyContext($context): string |
||
140 | |||
141 | /** |
||
142 | * @param object $object |
||
143 | * |
||
144 | * @return string |
||
145 | */ |
||
146 | private static function stringifyObjectContext($object): string |
||
154 | } |
||
155 |