1 | <?php |
||
24 | class SettingsManager |
||
25 | { |
||
26 | /** |
||
27 | * @var TranslatorInterface |
||
28 | */ |
||
29 | protected $translator; |
||
30 | |||
31 | /** |
||
32 | * @var EventDispatcherInterface |
||
33 | */ |
||
34 | protected $eventDispatcher; |
||
35 | |||
36 | /** |
||
37 | * @var Manager |
||
38 | */ |
||
39 | protected $manager; |
||
40 | |||
41 | /** |
||
42 | * @var Repository |
||
43 | */ |
||
44 | protected $repo; |
||
45 | |||
46 | /** |
||
47 | * @param TranslatorInterface $translator |
||
48 | * @param EventDispatcherInterface $eventDispatcher |
||
49 | * @param Manager $manager |
||
50 | */ |
||
51 | public function __construct( |
||
61 | |||
62 | /** |
||
63 | * Overwrites setting with given name. |
||
64 | * |
||
65 | * @param string $name |
||
66 | * @param string $type |
||
67 | * @param string $description |
||
68 | * @param string|array $value |
||
69 | * @param array $profiles |
||
70 | * |
||
71 | * @throws \LogicException |
||
72 | */ |
||
73 | public function set($name, $type, $description, $value, $profiles) |
||
91 | |||
92 | /** |
||
93 | * Saves setting. |
||
94 | * |
||
95 | * @param array $settings |
||
96 | */ |
||
97 | public function save(array $settings) |
||
106 | |||
107 | /** |
||
108 | * Removes a setting. |
||
109 | * |
||
110 | * @param Setting $setting |
||
111 | */ |
||
112 | public function remove(Setting $setting) |
||
120 | |||
121 | /** |
||
122 | * Copy a setting to the new profile. |
||
123 | * |
||
124 | * @param Setting $setting |
||
125 | * @param array $newProfiles |
||
126 | */ |
||
127 | public function duplicate(Setting $setting, $newProfiles) |
||
140 | |||
141 | /** |
||
142 | * Returns setting model by name and profile or creates new if $mustExist is set to FALSE. |
||
143 | * |
||
144 | * @param string $name |
||
145 | * @param string $profile |
||
146 | * @param bool $mustExist |
||
147 | * @param string $type |
||
148 | * |
||
149 | * @throws \UnexpectedValueException |
||
150 | * |
||
151 | * @return Setting |
||
152 | */ |
||
153 | public function get($name, $profile = 'default', $mustExist = true, $type = 'string') |
||
165 | |||
166 | /** |
||
167 | * Creates new setting object. |
||
168 | * |
||
169 | * @param string $name |
||
170 | * @param string $profile |
||
171 | * @param string $type |
||
172 | * |
||
173 | * @return Setting |
||
174 | */ |
||
175 | protected function createSetting($name, $profile, $type) |
||
189 | } |
||
190 |
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: