1 | <?php |
||
22 | class ConditionProcessorFactory implements SingletonInterface |
||
23 | { |
||
24 | use ExtendedFacadeInstanceTrait { |
||
25 | get as getInstance; |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @var ConditionProcessor[] |
||
30 | */ |
||
31 | private $processorInstances = []; |
||
32 | |||
33 | /** |
||
34 | * @param FormObject $formObject |
||
35 | * @return ConditionProcessor |
||
36 | */ |
||
37 | public function get(FormObject $formObject) |
||
47 | |||
48 | /** |
||
49 | * Will either fetch the processor instance from cache, using the given |
||
50 | * identifier, or calculate it and store it in cache. |
||
51 | * |
||
52 | * @param string $cacheIdentifier |
||
53 | * @param FormObject $formObject |
||
54 | * @return ConditionProcessor |
||
55 | */ |
||
56 | protected function fetchProcessorInstanceFromCache($cacheIdentifier, FormObject $formObject) |
||
73 | |||
74 | /** |
||
75 | * Used in unit tests. |
||
76 | * |
||
77 | * @param FormObject $formObject |
||
78 | * @return ConditionProcessor |
||
79 | */ |
||
80 | protected function getNewProcessorInstance(FormObject $formObject) |
||
87 | |||
88 | /** |
||
89 | * @param FormObject $formObject |
||
90 | * @return string |
||
91 | */ |
||
92 | protected function getCacheIdentifier(FormObject $formObject) |
||
96 | } |
||
97 |