1 | <?php |
||
17 | class ServiceRegistry implements EventDispatcherInterface |
||
18 | { |
||
19 | |||
20 | use EventDispatcherTrait; |
||
21 | |||
22 | /** |
||
23 | * LocatorInterface implementation instance. |
||
24 | * |
||
25 | * @var \Cake\ORM\Locator\LocatorInterface |
||
26 | */ |
||
27 | protected static $_locator; |
||
28 | |||
29 | /** |
||
30 | * Default LocatorInterface implementation class. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected static $_defaultLocatorClass = 'CakeDC\Api\Service\Locator\ServiceLocator'; |
||
35 | |||
36 | /** |
||
37 | * Sets and returns a singleton instance of LocatorInterface implementation. |
||
38 | * |
||
39 | * @param \CakeDC\Api\Service\Locator\LocatorInterface|null $locator Instance of a locator to use. |
||
40 | * @return \CakeDC\Api\Service\Locator\LocatorInterface |
||
41 | * @deprecated 3.5.0 Use getServiceLocator()/setServiceLocator() instead. |
||
42 | */ |
||
43 | public static function locator(LocatorInterface $locator = null) |
||
55 | |||
56 | /** |
||
57 | * Returns a singleton instance of LocatorInterface implementation. |
||
58 | * |
||
59 | * @return \CakeDC\Api\Service\Locator\LocatorInterface |
||
60 | */ |
||
61 | 108 | public static function getServiceLocator() |
|
69 | |||
70 | /** |
||
71 | * Sets singleton instance of LocatorInterface implementation. |
||
72 | * |
||
73 | * @param \CakeDC\Api\Service\Locator\LocatorInterface $serviceLocator Instance of a locator to use. |
||
74 | * @return void |
||
75 | */ |
||
76 | public static function setServiceLocator(LocatorInterface $serviceLocator) |
||
80 | |||
81 | /** |
||
82 | * Stores a list of options to be used when instantiating an object |
||
83 | * with a matching alias. |
||
84 | * |
||
85 | * @param string|null $alias Name of the alias |
||
86 | * @param array|null $options list of options for the alias |
||
87 | * @return array The config data. |
||
88 | * @deprecated 3.6.0 Use \CakeDC\Api\Service\Locator\ServiceLocator::getConfig()/setConfig() instead. |
||
89 | */ |
||
90 | public static function config($alias = null, $options = null) |
||
99 | |||
100 | /** |
||
101 | * Get a table instance from the registry. |
||
102 | * |
||
103 | * @param string $alias The alias name you want to get. |
||
104 | * @param array $options The options you want to build the table with. |
||
105 | * @return \CakeDC\Api\Service\Service |
||
106 | * @deprecated 3.6.0 Use \CakeDC\Api\Service\Locator\ServiceLocator::get() instead. |
||
107 | */ |
||
108 | 35 | public static function get($alias, array $options = []) |
|
112 | |||
113 | /** |
||
114 | * Check to see if an instance exists in the registry. |
||
115 | * |
||
116 | * @param string $alias The alias to check for. |
||
117 | * @return bool |
||
118 | * @deprecated 3.6.0 Use \CakeDC\Api\Service\Locator\ServiceLocator::exists() instead. |
||
119 | */ |
||
120 | public static function exists($alias) |
||
124 | |||
125 | /** |
||
126 | * Set an instance. |
||
127 | * |
||
128 | * @param string $alias The alias to set. |
||
129 | * @param \CakeDC\Api\Service\Service $object The table to set. |
||
130 | * @return \CakeDC\Api\Service\Service |
||
131 | * @deprecated 3.6.0 Use \CakeDC\Api\Service\Locator\ServiceLocator::set() instead. |
||
132 | */ |
||
133 | public static function set($alias, Service $object) |
||
137 | |||
138 | /** |
||
139 | * Removes an instance from the registry. |
||
140 | * |
||
141 | * @param string $alias The alias to remove. |
||
142 | * @return void |
||
143 | * @deprecated 3.6.0 Use \CakeDC\Api\Service\Locator\ServiceLocator::remove() instead. |
||
144 | */ |
||
145 | public static function remove($alias) |
||
149 | |||
150 | /** |
||
151 | * Clears the registry of configuration and instances. |
||
152 | * |
||
153 | * @return void |
||
154 | * @deprecated 3.6.0 Use \CakeDC\Api\Service\Locator\ServiceLocator::clear() instead. |
||
155 | */ |
||
156 | 108 | public static function clear() |
|
160 | |||
161 | /** |
||
162 | * Proxy for static calls on a locator. |
||
163 | * |
||
164 | * @param string $name Method name. |
||
165 | * @param array $arguments Method arguments. |
||
166 | * @return mixed |
||
167 | */ |
||
168 | public static function __callStatic($name, $arguments) |
||
177 | } |
||
178 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..