Passed
Branch master (f10acd)
by Jonas
13:13
created
Category
migrations/2018_11_22_100000_create_content_type_strings_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function up()
13 13
     {
14
-        Schema::create('content_type_strings', function (Blueprint $table) {
14
+        Schema::create('content_type_strings', function(Blueprint $table) {
15 15
             $table->bigIncrements('id');
16 16
             $table->nullableMorphs('linkable');
17 17
             $table->string('locale', 5);
Please login to merge, or discard this patch.
migrations/2018_11_22_100000_create_content_type_texts_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function up()
13 13
     {
14
-        Schema::create('content_type_texts', function (Blueprint $table) {
14
+        Schema::create('content_type_texts', function(Blueprint $table) {
15 15
             $table->bigIncrements('id');
16 16
             $table->nullableMorphs('linkable');
17 17
             $table->string('locale', 5);
Please login to merge, or discard this patch.
src/Providers/TranslationServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
      */
14 14
     protected function registerLoader()
15 15
     {
16
-        $this->app->singleton('translation.loader', function ($app) {
16
+        $this->app->singleton('translation.loader', function($app) {
17 17
             $class = $this->app['config']->get('laravel-multilingual.translation_manager');
18 18
 
19 19
             return new $class($app['files'], $app['path.lang']);
Please login to merge, or discard this patch.
src/Services/TranslationLoaderManager.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,10 +41,10 @@
 block discarded – undo
41 41
         string $namespace = null
42 42
     ): array {
43 43
         return collect(config('laravel-multilingual.translation_loaders'))
44
-            ->map(function (string $className) {
44
+            ->map(function(string $className) {
45 45
                 return app($className);
46 46
             })
47
-            ->mapWithKeys(function (TranslationLoader $translationLoader) use ($locale, $group, $namespace) {
47
+            ->mapWithKeys(function(TranslationLoader $translationLoader) use ($locale, $group, $namespace) {
48 48
                 return $translationLoader->loadTranslations($locale, $group, $namespace);
49 49
             })
50 50
             ->toArray();
Please login to merge, or discard this patch.
src/Services/Locale.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
             throw new LocaleServiceNotAvailableException();
97 97
         }
98 98
 
99
-        return $service->mapWithKeys(function ($locale) {
99
+        return $service->mapWithKeys(function($locale) {
100 100
             return [$locale => $locale];
101 101
         });
102 102
     }
Please login to merge, or discard this patch.
src/Models/Traits/TranslationCalls.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,11 +11,11 @@  discard block
 block discarded – undo
11 11
      */
12 12
     public static function bootTranslationCalls()
13 13
     {
14
-        static::updated(function (self $model) {
14
+        static::updated(function(self $model) {
15 15
             $model->flushGroupCache();
16 16
         });
17 17
 
18
-        static::deleted(function (self $model) {
18
+        static::deleted(function(self $model) {
19 19
             $model->flushGroupCache();
20 20
         });
21 21
     }
@@ -30,15 +30,15 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public static function getTranslationsForGroup(string $locale, string $group): array
32 32
     {
33
-        return Cache::rememberForever(static::getCacheKey($group, $locale), function () use ($group, $locale) {
33
+        return Cache::rememberForever(static::getCacheKey($group, $locale), function() use ($group, $locale) {
34 34
             return static::query()
35
-                ->where(function ($query) use ($group) {
35
+                ->where(function($query) use ($group) {
36 36
                     $query->where('group', $group);
37 37
                     $query->orWhere('group', 'LIKE', $group.'.%');
38 38
                 })
39 39
                 ->where('locale', $locale)
40 40
                 ->get()
41
-                ->reduce(function ($lines, $model) use ($group) {
41
+                ->reduce(function($lines, $model) use ($group) {
42 42
                     if (!is_null($model->value)) {
43 43
                         $group = collect(explode('.', $model->group))
44 44
                             ->slice(1) // Remove first entry for laravel compatibility. The first segment is the filename on the default file loader.
Please login to merge, or discard this patch.
src/Models/Traits/Translatable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public static function bootTranslatable()
26 26
     {
27
-        static::saved(function (Model $model) {
27
+        static::saved(function(Model $model) {
28 28
             foreach ($model->translationValues as $attributeName=>$values) {
29 29
                 $model->storeAttributeTranslations($attributeName, $values);
30 30
             }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
         $value = !is_array($value) ? [$locale => $value] : $value;
178 178
 
179 179
         // Map values to translation attributes
180
-        $this->translationValues[$name] = collect($value)->mapWithKeys(function ($value, $locale) {
180
+        $this->translationValues[$name] = collect($value)->mapWithKeys(function($value, $locale) {
181 181
             return [$locale => $value];
182 182
         })->toArray();
183 183
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
     {
257 257
         $translations = $this->translatableRelationByAttribute($attribute)->where('key', $attribute)->get();
258 258
 
259
-        $this->translationValues[$attribute] = collect($translations)->mapWithKeys(function ($item) {
259
+        $this->translationValues[$attribute] = collect($translations)->mapWithKeys(function($item) {
260 260
             return [$item->locale => $item->value];
261 261
         })->toArray();
262 262
 
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
             $locale = app(Locale::class)->current;
289 289
         }
290 290
 
291
-        return collect($this->translations)->map(function ($type, $key) use ($locale) {
291
+        return collect($this->translations)->map(function($type, $key) use ($locale) {
292 292
             return $this->getAttributeTranslation($key, $locale);
293 293
         })->toArray();
294 294
     }
Please login to merge, or discard this patch.