1 | <?php |
||
19 | class DefaultHashGenerator |
||
20 | { |
||
21 | /** |
||
22 | * @var ContextProvider[] |
||
23 | */ |
||
24 | private $providers = []; |
||
25 | |||
26 | /** |
||
27 | * Constructor. |
||
28 | * |
||
29 | * @param ContextProvider[] $providers |
||
30 | * |
||
31 | * @throws InvalidArgumentException If no providers are supplied |
||
32 | */ |
||
33 | 2 | public function __construct(array $providers) |
|
43 | |||
44 | /** |
||
45 | * Collect UserContext parameters and generate a hash from that. |
||
46 | * |
||
47 | * @return string The hash generated |
||
48 | */ |
||
49 | 1 | public function generateHash() |
|
64 | |||
65 | /** |
||
66 | * Register a provider to be called for updating a UserContext before generating the Hash. |
||
67 | * |
||
68 | * @param ContextProvider $provider A context provider to be called to get context information about the current request |
||
69 | */ |
||
70 | 1 | private function registerProvider(ContextProvider $provider) |
|
74 | } |
||
75 |