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 Setting $setting |
||
96 | */ |
||
97 | public function save(Setting $setting) |
||
104 | |||
105 | /** |
||
106 | * Removes a setting. |
||
107 | * |
||
108 | * @param Setting $setting |
||
109 | */ |
||
110 | public function remove(Setting $setting) |
||
118 | |||
119 | /** |
||
120 | * Copy a setting to the new profile. |
||
121 | * |
||
122 | * @param Setting $setting |
||
123 | * @param string $newProfile |
||
124 | */ |
||
125 | public function duplicate(Setting $setting, $newProfile) |
||
134 | |||
135 | /** |
||
136 | * Returns setting model by name and profile or creates new if $mustExist is set to FALSE. |
||
137 | * |
||
138 | * @param string $name |
||
139 | * @param string $profile |
||
140 | * @param bool $mustExist |
||
141 | * @param string $type |
||
142 | * |
||
143 | * @throws \UnexpectedValueException |
||
144 | * |
||
145 | * @return Setting |
||
146 | */ |
||
147 | public function get($name, $profile = 'default', $mustExist = true, $type = 'string') |
||
159 | |||
160 | /** |
||
161 | * Creates new setting object. |
||
162 | * |
||
163 | * @param string $name |
||
164 | * @param string $profile |
||
165 | * @param string $type |
||
166 | * |
||
167 | * @return Setting |
||
168 | */ |
||
169 | protected function createSetting($name, $profile, $type) |
||
183 | } |
||
184 |
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: