Completed
Push — master ( b18242...9fb221 )
by Mārtiņš
01:55
created
src/MessageRevisions.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
     /**
Please login to merge, or discard this patch.
src/MessageExtractor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -155,12 +155,12 @@
 block discarded – undo
155 155
 
156 156
         // If extensions are set, filter other files out
157 157
         if (!empty($item->extensions)) {
158
-            $files = array_filter($files, function ($file) use ($item) {
158
+            $files = array_filter($files, function($file) use ($item) {
159 159
                 return in_array($file['extension'], $item->extensions);
160 160
             });
161 161
         }
162 162
 
163
-        return array_map(function ($file) use ($dir) {
163
+        return array_map(function($file) use ($dir) {
164 164
             return $dir . DIRECTORY_SEPARATOR . $file['path'];
165 165
         }, $files);
166 166
     }
Please login to merge, or discard this patch.
src/MessageStorage.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function saveTranslations(Translations $translations)
38 38
     {
39 39
         $locale = $translations->getLanguage();
40
-        $domain = (string)$translations->getDomain();
40
+        $domain = (string) $translations->getDomain();
41 41
 
42 42
         if (!$locale) {
43 43
             throw new InvalidTranslationException('Locale is missing');
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
         $item->key = $this->getKey($locale, $domain, $translation);
182 182
         $item->domain = $domain;
183 183
         $item->locale = $locale;
184
-        $item->context = (string)$translation->getContext();
184
+        $item->context = (string) $translation->getContext();
185 185
         $item->original = $translation->getOriginal();
186 186
         $item->translation = $translation->getTranslation();
187 187
         $item->originalPlural = $translation->getPlural();
@@ -225,8 +225,8 @@  discard block
 block discarded – undo
225 225
     {
226 226
         return $this->convertItems(
227 227
             $locale,
228
-            (string)$domain,
229
-            $this->repository->getAll($locale, (string)$domain)
228
+            (string) $domain,
229
+            $this->repository->getAll($locale, (string) $domain)
230 230
         );
231 231
     }
232 232
 
@@ -241,8 +241,8 @@  discard block
 block discarded – undo
241 241
     {
242 242
         return $this->convertItems(
243 243
             $locale,
244
-            (string)$domain,
245
-            $this->repository->getEnabled($locale, (string)$domain)
244
+            (string) $domain,
245
+            $this->repository->getEnabled($locale, (string) $domain)
246 246
         );
247 247
     }
248 248
 
@@ -255,9 +255,9 @@  discard block
 block discarded – undo
255 255
      */
256 256
     public function getEnabledTranslated(string $locale, $domain): Translations
257 257
     {
258
-        $items = $this->repository->getEnabledTranslated($locale, (string)$domain);
258
+        $items = $this->repository->getEnabledTranslated($locale, (string) $domain);
259 259
 
260
-        return $this->convertItems($locale, (string)$domain, $items);
260
+        return $this->convertItems($locale, (string) $domain, $items);
261 261
     }
262 262
 
263 263
     /**
@@ -269,9 +269,9 @@  discard block
 block discarded – undo
269 269
      */
270 270
     public function getEnabledTranslatedJs(string $locale, $domain): Translations
271 271
     {
272
-        $items = $this->repository->getEnabledTranslatedJs($locale, (string)$domain);
272
+        $items = $this->repository->getEnabledTranslatedJs($locale, (string) $domain);
273 273
 
274
-        return $this->convertItems($locale, (string)$domain, $items);
274
+        return $this->convertItems($locale, (string) $domain, $items);
275 275
     }
276 276
 
277 277
     /**
@@ -285,8 +285,8 @@  discard block
 block discarded – undo
285 285
     {
286 286
         return $this->convertItems(
287 287
             $locale,
288
-            (string)$domain,
289
-            $this->repository->getRequiresTranslating($locale, (string)$domain)
288
+            (string) $domain,
289
+            $this->repository->getRequiresTranslating($locale, (string) $domain)
290 290
         );
291 291
     }
292 292
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
      */
301 301
     private function convertItems(string $locale, $domain, array $items): Translations
302 302
     {
303
-        $domain = (string)$domain;
303
+        $domain = (string) $domain;
304 304
 
305 305
         $translations = new Translations;
306 306
         $translations->setDomain($domain);
Please login to merge, or discard this patch.