Completed
Push — master ( bcc053...84e7ff )
by Mārtiņš
01:39
created
src/MessageArrayRepository.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function getAll(string $locale, string $domain): array
26 26
     {
27
-        return array_filter($this->store, function (MessageItem $item) use ($locale, $domain) {
27
+        return array_filter($this->store, function(MessageItem $item) use ($locale, $domain) {
28 28
             return $item->locale === $locale && $item->domain === $domain;
29 29
         });
30 30
     }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     {
37 37
         $allItems = $this->getAll($locale, $domain);
38 38
 
39
-        return array_filter($allItems, function (MessageItem $item) {
39
+        return array_filter($allItems, function(MessageItem $item) {
40 40
             return !$item->isDisabled;
41 41
         });
42 42
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $enabledItems = $this->getEnabled($locale, $domain);
51 51
 
52
-        return array_filter($enabledItems, function (MessageItem $item) {
52
+        return array_filter($enabledItems, function(MessageItem $item) {
53 53
             return $item->hasOriginalTranslation;
54 54
         });
55 55
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     {
62 62
         $enabledTranslated = $this->getEnabledTranslated($locale, $domain);
63 63
 
64
-        return array_filter($enabledTranslated, function (MessageItem $item) {
64
+        return array_filter($enabledTranslated, function(MessageItem $item) {
65 65
             return $item->isInJs;
66 66
         });
67 67
     }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
      */
86 86
     public function setAllAsNotInFilesAndInJs(string $locale, string $domain)
87 87
     {
88
-        $this->store = array_map(function (MessageItem $item) use ($locale, $domain) {
88
+        $this->store = array_map(function(MessageItem $item) use ($locale, $domain) {
89 89
             if ($item->domain === $domain && $item->locale === $locale) {
90 90
                 $item->isInFile = false;
91 91
                 $item->isInJs = false;
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
      */
100 100
     public function setAllAsNotDynamic(string $locale, string $domain)
101 101
     {
102
-        $this->store = array_map(function (MessageItem $item) use ($locale, $domain) {
102
+        $this->store = array_map(function(MessageItem $item) use ($locale, $domain) {
103 103
             if ($item->domain === $domain && $item->locale === $locale) {
104 104
                 $item->isDynamic = false;
105 105
             }
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      */
113 113
     public function getRequiresTranslating(string $locale, string $domain): array
114 114
     {
115
-        return array_filter($this->getEnabled($locale, $domain), function (MessageItem $item) {
115
+        return array_filter($this->getEnabled($locale, $domain), function(MessageItem $item) {
116 116
             return $item->requiresTranslating;
117 117
         });
118 118
     }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function disableUnused()
124 124
     {
125
-        $this->store = array_map(function (MessageItem $item) {
125
+        $this->store = array_map(function(MessageItem $item) {
126 126
             $item->isDisabled = !$item->isDynamic && !$item->isInJs && !$item->isInFile;
127 127
             return $item;
128 128
         }, $this->store);
Please login to merge, or discard this patch.
src/MessageExtractor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
         }
56 56
 
57 57
         /** @var Translations[] $allTranslations [domain => translations, ...] */
58
-        $allTranslations = array_reduce($domains, function (&$carry, string $domain) use ($defaultDomain) {
58
+        $allTranslations = array_reduce($domains, function(&$carry, string $domain) use ($defaultDomain) {
59 59
             $translations = new Translations();
60 60
 
61 61
             // When we scan for default domain, we have to specify an empty value
@@ -165,11 +165,11 @@  discard block
 block discarded – undo
165 165
         $extensions = $item->extensions ?: array_keys(self::EXTRACTORS);
166 166
 
167 167
         // If extensions are set, filter other files out
168
-        $files = array_filter($files, function ($file) use ($item, $extensions) {
168
+        $files = array_filter($files, function($file) use ($item, $extensions) {
169 169
             return in_array($file['extension'], $extensions);
170 170
         });
171 171
 
172
-        return array_map(function ($file) use ($dir) {
172
+        return array_map(function($file) use ($dir) {
173 173
             return $dir . DIRECTORY_SEPARATOR . $file['path'];
174 174
         }, $files);
175 175
     }
Please login to merge, or discard this patch.
src/MessageStorage.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -304,7 +304,7 @@  discard block
 block discarded – undo
304 304
         $item->key = $this->getKey($locale, $domain, $translation);
305 305
         $item->domain = $domain;
306 306
         $item->locale = $locale;
307
-        $item->context = (string)$translation->getContext();
307
+        $item->context = (string) $translation->getContext();
308 308
         $item->original = $translation->getOriginal();
309 309
         $item->translation = $translation->getTranslation();
310 310
         $item->originalPlural = $translation->getPlural();
@@ -348,8 +348,8 @@  discard block
 block discarded – undo
348 348
     {
349 349
         return $this->convertItems(
350 350
             $locale,
351
-            (string)$domain,
352
-            $this->repository->getAll($locale, (string)$domain)
351
+            (string) $domain,
352
+            $this->repository->getAll($locale, (string) $domain)
353 353
         );
354 354
     }
355 355
 
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
     {
365 365
         return $this->convertItems(
366 366
             $locale,
367
-            (string)$domain,
368
-            $this->repository->getEnabled($locale, (string)$domain)
367
+            (string) $domain,
368
+            $this->repository->getEnabled($locale, (string) $domain)
369 369
         );
370 370
     }
371 371
 
@@ -378,9 +378,9 @@  discard block
 block discarded – undo
378 378
      */
379 379
     public function getEnabledTranslated(string $locale, $domain): Translations
380 380
     {
381
-        $items = $this->repository->getEnabledTranslated($locale, (string)$domain);
381
+        $items = $this->repository->getEnabledTranslated($locale, (string) $domain);
382 382
 
383
-        return $this->convertItems($locale, (string)$domain, $items);
383
+        return $this->convertItems($locale, (string) $domain, $items);
384 384
     }
385 385
 
386 386
     /**
@@ -392,9 +392,9 @@  discard block
 block discarded – undo
392 392
      */
393 393
     public function getEnabledTranslatedJs(string $locale, $domain): Translations
394 394
     {
395
-        $items = $this->repository->getEnabledTranslatedJs($locale, (string)$domain);
395
+        $items = $this->repository->getEnabledTranslatedJs($locale, (string) $domain);
396 396
 
397
-        return $this->convertItems($locale, (string)$domain, $items);
397
+        return $this->convertItems($locale, (string) $domain, $items);
398 398
     }
399 399
 
400 400
     /**
@@ -408,8 +408,8 @@  discard block
 block discarded – undo
408 408
     {
409 409
         return $this->convertItems(
410 410
             $locale,
411
-            (string)$domain,
412
-            $this->repository->getRequiresTranslating($locale, (string)$domain)
411
+            (string) $domain,
412
+            $this->repository->getRequiresTranslating($locale, (string) $domain)
413 413
         );
414 414
     }
415 415
 
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
      */
424 424
     private function convertItems(string $locale, $domain, array $items): Translations
425 425
     {
426
-        $domain = (string)$domain;
426
+        $domain = (string) $domain;
427 427
 
428 428
         $translations = new Translations();
429 429
         $translations->setDomain($domain);
Please login to merge, or discard this patch.