1 | <?php |
||
17 | class DispatcherProvider |
||
18 | { |
||
19 | /** |
||
20 | * @var callable {@link Dispatcher} provider |
||
21 | */ |
||
22 | static private $provider; |
||
23 | |||
24 | /** |
||
25 | * Whether a provider if defined. |
||
26 | * |
||
27 | * @return bool |
||
28 | */ |
||
29 | static public function defined() |
||
33 | |||
34 | /** |
||
35 | * Defines the {@link Dispatcher} provider. |
||
36 | * |
||
37 | * @param callable $provider |
||
38 | * |
||
39 | * @return callable|null The previous provider, or `null` if none was defined before. |
||
40 | */ |
||
41 | static public function define(callable $provider) |
||
49 | |||
50 | /** |
||
51 | * Returns a {@link Dispatcher} instance using the provider. |
||
52 | * |
||
53 | * @return Dispatcher |
||
54 | * |
||
55 | * @throws DispatcherProviderNotDefined if no provider is defined. |
||
56 | */ |
||
57 | static public function provide() |
||
68 | |||
69 | /** |
||
70 | * Clears the provider. |
||
71 | */ |
||
72 | static public function clear() |
||
76 | } |
||
77 |