1 | <?php |
||
33 | class TranslationManager |
||
34 | { |
||
35 | /** |
||
36 | * @var Repository |
||
37 | */ |
||
38 | private $repository; |
||
39 | |||
40 | /** |
||
41 | * @var HistoryManager |
||
42 | */ |
||
43 | private $historyManager; |
||
44 | |||
45 | /** |
||
46 | * @var EventDispatcherInterface |
||
47 | */ |
||
48 | private $dispatcher; |
||
49 | |||
50 | /** |
||
51 | * @param Repository $repository |
||
52 | * @param HistoryManager $manager |
||
53 | * @param EventDispatcherInterface $dispatcher |
||
54 | */ |
||
55 | public function __construct(Repository $repository, HistoryManager $manager, EventDispatcherInterface $dispatcher) |
||
61 | |||
62 | /** |
||
63 | * Edits object from translation. |
||
64 | * |
||
65 | * @param string $id |
||
66 | * @param Request $request Http request object. |
||
67 | */ |
||
68 | public function edit($id, Request $request) |
||
90 | |||
91 | /** |
||
92 | * Returns all active tags from translations |
||
93 | * @return array |
||
94 | */ |
||
95 | public function getTags() |
||
99 | |||
100 | /** |
||
101 | * Returns all active domains from translations |
||
102 | * @return array |
||
103 | */ |
||
104 | public function getDomains() |
||
108 | |||
109 | /** |
||
110 | * @param string $id |
||
111 | * |
||
112 | * @return Translation |
||
113 | * |
||
114 | * @throws BadRequestHttpException |
||
115 | */ |
||
116 | public function getTranslation($id) |
||
126 | |||
127 | /** |
||
128 | * Returns all translations if filters are not specified |
||
129 | * |
||
130 | * @param array $filters An array with specified limitations for results |
||
131 | * |
||
132 | * @return DocumentIterator |
||
133 | */ |
||
134 | public function getTranslations(array $filters = null) |
||
148 | |||
149 | /** |
||
150 | * @param Translation[] $translations |
||
151 | */ |
||
152 | public function saveTranslations($translations) |
||
160 | |||
161 | /** |
||
162 | * @param Translation $document |
||
163 | * @param array $messages |
||
164 | */ |
||
165 | private function updateMessages(Translation $document, array $messages) |
||
193 | |||
194 | /** |
||
195 | * @param Message $message |
||
196 | * @param string $locale |
||
197 | * @param string $text |
||
198 | * @param \DateTime $updatedAt |
||
199 | * |
||
200 | * @return Message |
||
201 | */ |
||
202 | private function updateMessageData(Message $message, $locale, $text, $updatedAt = null) |
||
214 | |||
215 | /** |
||
216 | * Returns a list of available tags or domains |
||
217 | * |
||
218 | * @param string $type |
||
219 | * @return array |
||
220 | */ |
||
221 | private function getItems($type) |
||
239 | |||
240 | /** |
||
241 | * Parses http request content from json to array. |
||
242 | * |
||
243 | * @param Request $request Http request object. |
||
244 | * |
||
245 | * @return array |
||
246 | * |
||
247 | * @throws BadRequestHttpException |
||
248 | */ |
||
249 | private function parseJsonContent(Request $request) |
||
259 | |||
260 | /** |
||
261 | * @param object $document |
||
262 | */ |
||
263 | private function commitTranslation($document) |
||
268 | } |
||
269 |
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: