1 | <?php |
||
27 | class SettingsManager |
||
28 | { |
||
29 | /** |
||
30 | * Symfony event dispatcher. |
||
31 | * |
||
32 | * @var EventDispatcherInterface |
||
33 | */ |
||
34 | private $eventDispatcher; |
||
35 | |||
36 | /** |
||
37 | * Elasticsearch manager which handles setting repository. |
||
38 | * |
||
39 | * @var Manager |
||
40 | */ |
||
41 | private $manager; |
||
42 | |||
43 | /** |
||
44 | * Settings repository. |
||
45 | * |
||
46 | * @var Repository |
||
47 | */ |
||
48 | private $repo; |
||
49 | |||
50 | /** |
||
51 | * Cache pool container. |
||
52 | * |
||
53 | * @var CacheProvider |
||
54 | */ |
||
55 | private $cache; |
||
56 | |||
57 | /** |
||
58 | * Cookie storage for active cookies. |
||
59 | * |
||
60 | * @var GenericCookie |
||
61 | */ |
||
62 | private $activeProfilesCookie; |
||
63 | |||
64 | /** |
||
65 | * Active profiles setting name to store in the cache engine. |
||
66 | * |
||
67 | * @var string |
||
68 | */ |
||
69 | private $activeProfilesSettingName; |
||
70 | |||
71 | /** |
||
72 | * @param Repository $repo |
||
73 | * @param EventDispatcherInterface $eventDispatcher |
||
74 | */ |
||
75 | public function __construct( |
||
83 | |||
84 | /** |
||
85 | * @return CacheProvider |
||
86 | */ |
||
87 | public function getCache() |
||
91 | |||
92 | /** |
||
93 | * @param CacheProvider $cache |
||
94 | */ |
||
95 | public function setCache($cache) |
||
99 | |||
100 | /** |
||
101 | * @return GenericCookie |
||
102 | */ |
||
103 | public function getActiveProfilesCookie() |
||
107 | |||
108 | /** |
||
109 | * @param GenericCookie $activeProfilesCookie |
||
110 | */ |
||
111 | public function setActiveProfilesCookie($activeProfilesCookie) |
||
115 | |||
116 | /** |
||
117 | * @return string |
||
118 | */ |
||
119 | public function getActiveProfilesSettingName() |
||
123 | |||
124 | /** |
||
125 | * @param string $activeProfilesSettingName |
||
126 | */ |
||
127 | public function setActiveProfilesSettingName($activeProfilesSettingName) |
||
131 | |||
132 | /** |
||
133 | * Creates setting. |
||
134 | * |
||
135 | * @param array $data |
||
136 | * |
||
137 | * @return Setting |
||
138 | */ |
||
139 | public function create(array $data = []) |
||
171 | |||
172 | /** |
||
173 | * Overwrites setting parameters with given name. |
||
174 | * |
||
175 | * @param string $name |
||
176 | * @param array $data |
||
177 | * |
||
178 | * @return Setting |
||
179 | */ |
||
180 | public function update($name, $data = []) |
||
198 | |||
199 | /** |
||
200 | * Deletes a setting. |
||
201 | * |
||
202 | * @param string $name |
||
203 | * |
||
204 | * @return array |
||
205 | */ |
||
206 | public function delete($name) |
||
211 | |||
212 | /** |
||
213 | * Returns setting object. |
||
214 | * |
||
215 | * @param string $name |
||
216 | * |
||
217 | * @return Setting |
||
218 | */ |
||
219 | public function get($name) |
||
226 | |||
227 | /** |
||
228 | * Returns setting object. |
||
229 | * |
||
230 | * @param string $name |
||
231 | * |
||
232 | * @return bool |
||
233 | */ |
||
234 | public function has($name) |
||
245 | |||
246 | /** |
||
247 | * Get setting value by current active profiles setting. |
||
248 | * |
||
249 | * @param string $name |
||
250 | * @param bool $default |
||
251 | * |
||
252 | * @return mixed |
||
253 | */ |
||
254 | public function getValue($name, $default = null) |
||
264 | |||
265 | /** |
||
266 | * Get setting value by checking also from cache engine. |
||
267 | * |
||
268 | * @param string $name |
||
269 | * @param bool $checkWithActiveProfiles Checks if setting is in active profile. |
||
270 | * |
||
271 | * @return mixed |
||
272 | */ |
||
273 | public function getCachedValue($name, $checkWithActiveProfiles = true) |
||
301 | |||
302 | /** |
||
303 | * Get all full profile information. |
||
304 | * |
||
305 | * @return array |
||
306 | */ |
||
307 | public function getAllProfiles() |
||
339 | |||
340 | /** |
||
341 | * Get profile names, optionally can return only active ones. |
||
342 | * |
||
343 | * @param bool $onlyActive |
||
344 | * |
||
345 | * @return array |
||
346 | */ |
||
347 | public function getAllProfilesNameList($onlyActive = false) |
||
362 | |||
363 | /** |
||
364 | * Returns cached active profiles names list. |
||
365 | * |
||
366 | * @return array |
||
367 | */ |
||
368 | public function getActiveProfiles() |
||
380 | } |
||
381 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: