1 | <?php |
||
28 | class SettingsManager |
||
29 | { |
||
30 | /** |
||
31 | * Symfony event dispatcher. |
||
32 | * |
||
33 | * @var EventDispatcherInterface |
||
34 | */ |
||
35 | private $eventDispatcher; |
||
36 | |||
37 | /** |
||
38 | * Elasticsearch manager which handles setting repository. |
||
39 | * |
||
40 | * @var Manager |
||
41 | */ |
||
42 | private $manager; |
||
43 | |||
44 | /** |
||
45 | * Settings repository. |
||
46 | * |
||
47 | * @var Repository |
||
48 | */ |
||
49 | private $repo; |
||
50 | |||
51 | /** |
||
52 | * Cache pool container. |
||
53 | * |
||
54 | * @var CacheProvider |
||
55 | */ |
||
56 | private $cache; |
||
57 | |||
58 | /** |
||
59 | * Cookie storage for active cookies. |
||
60 | * |
||
61 | * @var GenericCookie |
||
62 | */ |
||
63 | private $activeProfilesCookie; |
||
64 | |||
65 | /** |
||
66 | * Active profiles setting name to store in the cache engine. |
||
67 | * |
||
68 | * @var string |
||
69 | */ |
||
70 | private $activeProfilesSettingName; |
||
71 | |||
72 | /** |
||
73 | * @param Repository $repo |
||
74 | * @param EventDispatcherInterface $eventDispatcher |
||
75 | */ |
||
76 | public function __construct( |
||
84 | |||
85 | /** |
||
86 | * @return CacheProvider |
||
87 | */ |
||
88 | public function getCache() |
||
92 | |||
93 | /** |
||
94 | * @param CacheProvider $cache |
||
95 | */ |
||
96 | public function setCache($cache) |
||
100 | |||
101 | /** |
||
102 | * @return GenericCookie |
||
103 | */ |
||
104 | public function getActiveProfilesCookie() |
||
108 | |||
109 | /** |
||
110 | * @param GenericCookie $activeProfilesCookie |
||
111 | */ |
||
112 | public function setActiveProfilesCookie($activeProfilesCookie) |
||
116 | |||
117 | /** |
||
118 | * @return string |
||
119 | */ |
||
120 | public function getActiveProfilesSettingName() |
||
124 | |||
125 | /** |
||
126 | * @param string $activeProfilesSettingName |
||
127 | */ |
||
128 | public function setActiveProfilesSettingName($activeProfilesSettingName) |
||
132 | |||
133 | /** |
||
134 | * Creates setting. |
||
135 | * |
||
136 | * @param array $data |
||
137 | * |
||
138 | * @return Setting |
||
139 | */ |
||
140 | public function create(array $data = []) |
||
172 | |||
173 | /** |
||
174 | * Overwrites setting parameters with given name. |
||
175 | * |
||
176 | * @param string $name |
||
177 | * @param array $data |
||
178 | * |
||
179 | * @return Setting |
||
180 | */ |
||
181 | public function update($name, $data = []) |
||
199 | |||
200 | /** |
||
201 | * Deletes a setting. |
||
202 | * |
||
203 | * @param string $name |
||
204 | * |
||
205 | * @return array |
||
206 | */ |
||
207 | public function delete($name) |
||
212 | |||
213 | /** |
||
214 | * Returns setting object. |
||
215 | * |
||
216 | * @param string $name |
||
217 | * |
||
218 | * @return Setting |
||
219 | */ |
||
220 | public function get($name) |
||
227 | |||
228 | /** |
||
229 | * Returns setting object. |
||
230 | * |
||
231 | * @param string $name |
||
232 | * |
||
233 | * @return bool |
||
234 | */ |
||
235 | public function has($name) |
||
246 | |||
247 | /** |
||
248 | * Get setting value by current active profiles setting. |
||
249 | * |
||
250 | * @param string $name |
||
251 | * @param bool $default |
||
252 | * |
||
253 | * @return mixed |
||
254 | */ |
||
255 | public function getValue($name, $default = null) |
||
265 | |||
266 | /** |
||
267 | * Get all full profile information. |
||
268 | * |
||
269 | * @return array |
||
270 | */ |
||
271 | public function getAllProfiles() |
||
303 | |||
304 | /** |
||
305 | * Get only profile names. |
||
306 | * |
||
307 | * @param bool $onlyActive |
||
308 | * |
||
309 | * @return array |
||
310 | */ |
||
311 | public function getAllProfilesNameList($onlyActive = false) |
||
326 | } |
||
327 |
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: