@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | |
57 | 57 | private function generateHash(Translations $translations): string |
58 | 58 | { |
59 | - $array = array_map(function (Translation $t) { |
|
59 | + $array = array_map(function(Translation $t) { |
|
60 | 60 | return [ |
61 | 61 | $t->getOriginal(), |
62 | 62 | $t->getPlural(), |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $t->getPluralTranslations(), |
65 | 65 | $t->getContext(), |
66 | 66 | ]; |
67 | - }, (array)$translations); |
|
67 | + }, (array) $translations); |
|
68 | 68 | |
69 | 69 | return substr(md5(serialize($array)), 0, 6); // Take only 6, and pray for no collisions |
70 | 70 | } |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | throw new InvalidPathException('Directory does not exist (' . $this->config->getMoDirectory() . ')'); |
129 | 129 | } |
130 | 130 | |
131 | - return (bool)file_put_contents($pathname, json_encode($revisions->toArray(), JSON_PRETTY_PRINT)); |
|
131 | + return (bool) file_put_contents($pathname, json_encode($revisions->toArray(), JSON_PRETTY_PRINT)); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | /** |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | $item->key = $this->getKey($locale, $domain, $translation); |
250 | 250 | $item->domain = $domain; |
251 | 251 | $item->locale = $locale; |
252 | - $item->context = (string)$translation->getContext(); |
|
252 | + $item->context = (string) $translation->getContext(); |
|
253 | 253 | $item->original = $translation->getOriginal(); |
254 | 254 | $item->translation = $translation->getTranslation(); |
255 | 255 | $item->originalPlural = $translation->getPlural(); |
@@ -293,8 +293,8 @@ discard block |
||
293 | 293 | { |
294 | 294 | return $this->convertItems( |
295 | 295 | $locale, |
296 | - (string)$domain, |
|
297 | - $this->repository->getAll($locale, (string)$domain) |
|
296 | + (string) $domain, |
|
297 | + $this->repository->getAll($locale, (string) $domain) |
|
298 | 298 | ); |
299 | 299 | } |
300 | 300 | |
@@ -309,8 +309,8 @@ discard block |
||
309 | 309 | { |
310 | 310 | return $this->convertItems( |
311 | 311 | $locale, |
312 | - (string)$domain, |
|
313 | - $this->repository->getEnabled($locale, (string)$domain) |
|
312 | + (string) $domain, |
|
313 | + $this->repository->getEnabled($locale, (string) $domain) |
|
314 | 314 | ); |
315 | 315 | } |
316 | 316 | |
@@ -323,9 +323,9 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public function getEnabledTranslated(string $locale, $domain): Translations |
325 | 325 | { |
326 | - $items = $this->repository->getEnabledTranslated($locale, (string)$domain); |
|
326 | + $items = $this->repository->getEnabledTranslated($locale, (string) $domain); |
|
327 | 327 | |
328 | - return $this->convertItems($locale, (string)$domain, $items); |
|
328 | + return $this->convertItems($locale, (string) $domain, $items); |
|
329 | 329 | } |
330 | 330 | |
331 | 331 | /** |
@@ -337,9 +337,9 @@ discard block |
||
337 | 337 | */ |
338 | 338 | public function getEnabledTranslatedJs(string $locale, $domain): Translations |
339 | 339 | { |
340 | - $items = $this->repository->getEnabledTranslatedJs($locale, (string)$domain); |
|
340 | + $items = $this->repository->getEnabledTranslatedJs($locale, (string) $domain); |
|
341 | 341 | |
342 | - return $this->convertItems($locale, (string)$domain, $items); |
|
342 | + return $this->convertItems($locale, (string) $domain, $items); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | /** |
@@ -353,8 +353,8 @@ discard block |
||
353 | 353 | { |
354 | 354 | return $this->convertItems( |
355 | 355 | $locale, |
356 | - (string)$domain, |
|
357 | - $this->repository->getRequiresTranslating($locale, (string)$domain) |
|
356 | + (string) $domain, |
|
357 | + $this->repository->getRequiresTranslating($locale, (string) $domain) |
|
358 | 358 | ); |
359 | 359 | } |
360 | 360 | |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | */ |
369 | 369 | private function convertItems(string $locale, $domain, array $items): Translations |
370 | 370 | { |
371 | - $domain = (string)$domain; |
|
371 | + $domain = (string) $domain; |
|
372 | 372 | |
373 | 373 | $translations = new Translations; |
374 | 374 | $translations->setDomain($domain); |
@@ -157,11 +157,11 @@ |
||
157 | 157 | $extensions = $item->extensions ?: array_keys(self::EXTRACTORS); |
158 | 158 | |
159 | 159 | // If extensions are set, filter other files out |
160 | - $files = array_filter($files, function ($file) use ($item, $extensions) { |
|
160 | + $files = array_filter($files, function($file) use ($item, $extensions) { |
|
161 | 161 | return in_array($file['extension'], $extensions); |
162 | 162 | }); |
163 | 163 | |
164 | - return array_map(function ($file) use ($dir) { |
|
164 | + return array_map(function($file) use ($dir) { |
|
165 | 165 | return $dir . DIRECTORY_SEPARATOR . $file['path']; |
166 | 166 | }, $files); |
167 | 167 | } |