1 | <?php |
||
15 | class DeferredCallbackLoader implements CallbackLoader { |
||
16 | |||
17 | /** |
||
18 | * @var array |
||
19 | */ |
||
20 | private $registry = array(); |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $singletons = array(); |
||
26 | |||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $expectedReturnTypeByHandler = array(); |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $recursiveMarker = array(); |
||
36 | |||
37 | /** |
||
38 | * @since 1.0 |
||
39 | * |
||
40 | * @param CallbackContainer|null $callbackContainer |
||
41 | */ |
||
42 | 24 | public function __construct( CallbackContainer $callbackContainer = null ) { |
|
47 | |||
48 | /** |
||
49 | * @since 1.0 |
||
50 | * |
||
51 | * @param CallbackContainer $callbackContainer |
||
52 | */ |
||
53 | 4 | public function registerCallbackContainer( CallbackContainer $callbackContainer ) { |
|
56 | |||
57 | /** |
||
58 | * @since 1.0 |
||
59 | * |
||
60 | * {@inheritDoc} |
||
61 | */ |
||
62 | 15 | public function registerCallback( $handlerName, Closure $callback ) { |
|
70 | |||
71 | /** |
||
72 | * If you are not running PHPUnit or for that matter any other testing |
||
73 | * environment then you are not suppose to use this function. |
||
74 | * |
||
75 | * @since 1.0 |
||
76 | * |
||
77 | * @param string $handlerName |
||
78 | * @param mixed $instance |
||
79 | */ |
||
80 | 4 | public function registerObject( $handlerName, $instance ) { |
|
91 | |||
92 | /** |
||
93 | * @since 1.0 |
||
94 | * |
||
95 | * {@inheritDoc} |
||
96 | */ |
||
97 | 13 | public function registerExpectedReturnType( $handlerName, $type ) { |
|
105 | |||
106 | /** |
||
107 | * @since 1.0 |
||
108 | * |
||
109 | * {@inheritDoc} |
||
110 | */ |
||
111 | 13 | public function create( $handlerName ) { |
|
118 | |||
119 | /** |
||
120 | * @since 1.0 |
||
121 | * @deprecated since 1.1 |
||
122 | * |
||
123 | * {@inheritDoc} |
||
124 | */ |
||
125 | 1 | public function load( $handlerName ) { |
|
132 | |||
133 | /** |
||
134 | * @since 1.0 |
||
135 | * |
||
136 | * {@inheritDoc} |
||
137 | */ |
||
138 | 11 | public function singleton( $handlerName ) { |
|
160 | |||
161 | /** |
||
162 | * @since 1.0 |
||
163 | * |
||
164 | * @param string $handlerName |
||
165 | */ |
||
166 | 1 | public function deregister( $handlerName ) { |
|
171 | |||
172 | 19 | private function addRecursiveMarkerFor( $handlerName ) { |
|
188 | |||
189 | 18 | private function getReturnValueFromCallbackHandlerFor( $handlerName, $parameters ) { |
|
207 | |||
208 | 11 | private function getReturnValueFromSingletonFor( $handlerName, $fingerprint ) { |
|
222 | |||
223 | } |
||
224 |