| 1 | <?php |
||
| 10 | trait StrategyCachingCapabilities |
||
| 11 | { |
||
| 12 | private static $strategyCache = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The cached strategy for the given class and property. |
||
| 16 | * |
||
| 17 | * @param string $class |
||
| 18 | * @param string $key |
||
| 19 | * |
||
| 20 | * @return mixed|null |
||
| 21 | */ |
||
| 22 | 8 | private function getCachedStrategy(string $class, string $key) |
|
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $class |
||
| 29 | * @param string $key |
||
| 30 | * @param mixed $strategy |
||
| 31 | * |
||
| 32 | * @return self |
||
| 33 | */ |
||
| 34 | 5 | private function setCachedStrategy(string $class, string $key, $strategy): self |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Computes cache key for class and property. |
||
| 43 | * |
||
| 44 | * @param string $class |
||
| 45 | * @param string $key |
||
| 46 | * |
||
| 47 | * @return string |
||
| 48 | */ |
||
| 49 | 8 | private function getCacheKey(string $class, string $key): string |
|
| 53 | } |
||
| 54 |