1 | <?php |
||
23 | class StorageService implements Storage |
||
24 | { |
||
25 | const DIRECTION_UP = 'up'; |
||
26 | const DIRECTION_DOWN = 'down'; |
||
27 | |||
28 | /** |
||
29 | * @var Storage[] |
||
30 | */ |
||
31 | private $localStorages = []; |
||
32 | |||
33 | /** |
||
34 | * @var Storage[] |
||
35 | */ |
||
36 | private $remoteStorages = []; |
||
37 | |||
38 | /** |
||
39 | * Download all remote storages into all local storages. |
||
40 | * This will overwrite your local copy. |
||
41 | */ |
||
42 | public function download() |
||
46 | |||
47 | /** |
||
48 | * Upload all local storages into all remote storages |
||
49 | * This will overwrite your remote copy. |
||
50 | */ |
||
51 | public function upload() |
||
55 | |||
56 | /** |
||
57 | * Synchronize translations with remote. |
||
58 | */ |
||
59 | public function sync($direction = self::DIRECTION_DOWN) |
||
74 | |||
75 | /** |
||
76 | * Download and merge all translations from remote storages down to your local storages. |
||
77 | * Only the local storages will be changed. |
||
78 | */ |
||
79 | public function mergeDown() |
||
83 | |||
84 | /** |
||
85 | * Upload and merge all translations from local storages up to your remote storages. |
||
86 | * Only the remote storages will be changed. |
||
87 | */ |
||
88 | public function mergeUp() |
||
92 | |||
93 | /** |
||
94 | * Get the very latest version we know of a message. First look at the remote storage |
||
95 | * fall back on the local ones. |
||
96 | * |
||
97 | * @param string $locale |
||
98 | * @param string $domain |
||
99 | * @param string $key |
||
100 | * |
||
101 | * @return null|Message |
||
102 | */ |
||
103 | public function syncAndFetchMessage($locale, $domain, $key) |
||
115 | |||
116 | /** |
||
117 | * Try to get a translation from all the storages, start looking in the first |
||
118 | * local storage and then move on to the remote storages. |
||
119 | * {@inheritdoc} |
||
120 | */ |
||
121 | public function get($locale, $domain, $key) |
||
132 | |||
133 | /** |
||
134 | * @param Storage[] $storages |
||
135 | * @param string $locale |
||
136 | * @param string $domain |
||
137 | * @param string $key |
||
138 | * |
||
139 | * @return null|Message |
||
140 | */ |
||
141 | private function getFromStorages($storages, $locale, $domain, $key) |
||
152 | |||
153 | /** |
||
154 | * Create all configured storages with this message. This will not overwrite |
||
155 | * existing message. |
||
156 | * |
||
157 | * {@inheritdoc} |
||
158 | */ |
||
159 | public function create(Message $message) |
||
165 | |||
166 | /** |
||
167 | * @param Storage[] $storages |
||
168 | * @param Message $message |
||
169 | */ |
||
170 | private function createStorages($storages, Message $message) |
||
181 | |||
182 | /** |
||
183 | * Update all configured storages with this message. If messages does not exist |
||
184 | * it will be created. |
||
185 | * |
||
186 | * {@inheritdoc} |
||
187 | */ |
||
188 | public function update(Message $message) |
||
194 | |||
195 | /** |
||
196 | * @param Storage[] $storages |
||
197 | * @param Message $message |
||
198 | */ |
||
199 | private function updateStorages($storages, Message $message) |
||
210 | |||
211 | /** |
||
212 | * Delete the message form all storages. |
||
213 | * |
||
214 | * {@inheritdoc} |
||
215 | */ |
||
216 | public function delete($locale, $domain, $key) |
||
222 | |||
223 | /** |
||
224 | * @param Storage[] $storages |
||
225 | * @param string $locale |
||
226 | * @param string $domain |
||
227 | * @param string $key |
||
228 | */ |
||
229 | private function deleteFromStorages($storages, $locale, $domain, $key) |
||
235 | |||
236 | /** |
||
237 | * @param Storage $localStorage |
||
238 | * |
||
239 | * @return StorageService |
||
240 | */ |
||
241 | public function addLocalStorage(Storage $localStorage) |
||
247 | |||
248 | /** |
||
249 | * @param Storage $remoteStorages |
||
250 | * |
||
251 | * @return StorageService |
||
252 | */ |
||
253 | public function addRemoteStorage(Storage $remoteStorage) |
||
259 | } |
||
260 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()
can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.