Completed
Push — master ( c62883...795ab8 )
by Nicolas
04:44
created
Repositories/Cache/CacheTranslationDecorator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
         return $this->cache
23 23
             ->tags($this->entityName, 'global')
24 24
             ->rememberForever("{$this->locale}.{$this->entityName}.findByKeyAndLocale.{$key}.{$locale}",
25
-                function () use ($key, $locale) {
25
+                function() use ($key, $locale) {
26 26
                     return $this->repository->findByKeyAndLocale($key, $locale);
27 27
                 }
28 28
             );
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         return $this->cache
34 34
             ->tags($this->entityName, 'global')
35 35
             ->rememberForever("{$this->locale}.{$this->entityName}.allFormatted",
36
-                function () {
36
+                function() {
37 37
                     return $this->repository->allFormatted();
38 38
                 }
39 39
             );
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         return $this->cache
52 52
             ->tags($this->entityName, 'global')
53 53
             ->rememberForever("{$this->locale}.{$this->entityName}.findTranslationByKey.{$key}",
54
-                function () use ($key) {
54
+                function() use ($key) {
55 55
                     return $this->repository->findTranslationByKey($key);
56 56
                 }
57 57
             );
Please login to merge, or discard this patch.
Repositories/Eloquent/EloquentTranslationRepository.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -25,11 +25,11 @@  discard block
 block discarded – undo
25 25
     public function allFormatted()
26 26
     {
27 27
         $allRows = $this->all();
28
-        $allDatabaseTranslations = [];
28
+        $allDatabaseTranslations = [ ];
29 29
         foreach ($allRows as $translation) {
30 30
             foreach (config('laravellocalization.supportedLocales') as $locale => $language) {
31 31
                 if ($translation->hasTranslation($locale)) {
32
-                    $allDatabaseTranslations[$locale][$translation->key] = $translation->translate($locale)->value;
32
+                    $allDatabaseTranslations[ $locale ][ $translation->key ] = $translation->translate($locale)->value;
33 33
                 }
34 34
             }
35 35
         }
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
     public function findTranslationByKey($key)
48 48
     {
49
-        return $this->model->firstOrCreate(['key' => $key]);
49
+        return $this->model->firstOrCreate([ 'key' => $key ]);
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
Services/TranslationsService.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 
33 33
         foreach ($allFileTranslations as $locale => $fileTranslation) {
34 34
             foreach ($fileTranslation as $key => $translation) {
35
-                if (isset($allDatabaseTranslations[$locale][$key])) {
36
-                    $allFileTranslations[$locale][$key] = $allDatabaseTranslations[$locale][$key];
37
-                    unset($allDatabaseTranslations[$locale][$key]);
35
+                if (isset($allDatabaseTranslations[ $locale ][ $key ])) {
36
+                    $allFileTranslations[ $locale ][ $key ] = $allDatabaseTranslations[ $locale ][ $key ];
37
+                    unset($allDatabaseTranslations[ $locale ][ $key ]);
38 38
                 }
39 39
             }
40 40
         }
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
         $activeLocales = $this->getActiveLocales();
55 55
 
56 56
         foreach ($allFileTranslations as $locale => $value) {
57
-            if (! in_array($locale, $activeLocales)) {
58
-                unset($allFileTranslations[$locale]);
57
+            if (!in_array($locale, $activeLocales)) {
58
+                unset($allFileTranslations[ $locale ]);
59 59
             }
60 60
         }
61 61
     }
@@ -66,10 +66,10 @@  discard block
 block discarded – undo
66 66
      */
67 67
     private function getActiveLocales()
68 68
     {
69
-        $locales = [];
69
+        $locales = [ ];
70 70
 
71 71
         foreach (config('laravellocalization.supportedLocales') as $locale => $translation) {
72
-            $locales[] = $locale;
72
+            $locales[ ] = $locale;
73 73
         }
74 74
 
75 75
         return $locales;
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
     {
84 84
         foreach ($allDatabaseTranslations as $locale => $group) {
85 85
             foreach ($group as $key => $value) {
86
-                $allFileTranslations[$locale][$key] = $value;
86
+                $allFileTranslations[ $locale ][ $key ] = $value;
87 87
             }
88 88
         }
89 89
     }
Please login to merge, or discard this patch.
Services/TranslationsWriter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
      */
78 78
     private function makeTree(TranslationGroup $translations)
79 79
     {
80
-        $tree = [];
80
+        $tree = [ ];
81 81
 
82 82
         foreach ($translations->allRaw() as $locale => $translation) {
83 83
             foreach ($translation as $key => $trans) {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
                 $fileName = $this->getFileNameFrom($key);
86 86
                 $key = str_replace($moduleName . '::' . $fileName . '.', '', $key);
87 87
 
88
-                array_set($tree[$locale][$moduleName][$fileName], $key, $trans);
88
+                array_set($tree[ $locale ][ $moduleName ][ $fileName ], $key, $trans);
89 89
             }
90 90
         }
91 91
 
Please login to merge, or discard this patch.
Sidebar/SidebarExtender.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
         if (false === config('asgard.translation.config.translations-gui')) {
33 33
             return $menu;
34 34
         }
35
-        $menu->group(trans('core::sidebar.content'), function (Group $group) {
36
-            $group->item(trans('translation::translations.title.translations'), function (Item $item) {
35
+        $menu->group(trans('core::sidebar.content'), function(Group $group) {
36
+            $group->item(trans('translation::translations.title.translations'), function(Item $item) {
37 37
                 $item->icon('fa fa-globe');
38 38
                 $item->weight(10);
39 39
                 $item->route('admin.translation.translation.index');
Please login to merge, or discard this patch.
ValueObjects/TranslationGroup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,11 +20,11 @@
 block discarded – undo
20 20
      */
21 21
     private function reArrangeTranslations(array $translationsRaw)
22 22
     {
23
-        $translations = [];
23
+        $translations = [ ];
24 24
 
25 25
         foreach ($translationsRaw as $locale => $translationGroup) {
26 26
             foreach ($translationGroup as $key => $translation) {
27
-                $translations[$key][$locale] = $translation;
27
+                $translations[ $key ][ $locale ] = $translation;
28 28
             }
29 29
         }
30 30
 
Please login to merge, or discard this patch.
Services/Translator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
      * @param  bool  $fallback
16 16
      * @return string
17 17
      */
18
-    public function get($key, array $replace = [], $locale = null, $fallback = true)
18
+    public function get($key, array $replace = [ ], $locale = null, $fallback = true)
19 19
     {
20 20
         $translationRepository = app(TranslationRepository::class);
21 21
         if ($translation = $translationRepository->findByKeyAndLocale($key, $locale)) {
Please login to merge, or discard this patch.
Database/Migrations/2013_04_09_062329_create_revisions_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@
 block discarded – undo
12 12
      */
13 13
     public function up()
14 14
     {
15
-        Schema::create('revisions', function (Blueprint $table) {
15
+        Schema::create('revisions', function(Blueprint $table) {
16 16
             $table->increments('id');
17 17
             $table->string('revisionable_type');
18 18
             $table->integer('revisionable_id');
Please login to merge, or discard this patch.
Providers/TranslationServiceProvider.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
 
56 56
     private function registerBindings()
57 57
     {
58
-        $this->app->bind(TranslationRepository::class, function () {
58
+        $this->app->bind(TranslationRepository::class, function() {
59 59
             $repository = new EloquentTranslationRepository(new Translation());
60 60
 
61 61
             return new CacheTranslationDecorator($repository);
62 62
         });
63 63
 
64
-        $this->app->bind(FileTranslationRepository::class, function ($app) {
65
-            return new FileDiskTranslationRepository($app['files'], $app['translation.loader']);
64
+        $this->app->bind(FileTranslationRepository::class, function($app) {
65
+            return new FileDiskTranslationRepository($app[ 'files' ], $app[ 'translation.loader' ]);
66 66
         });
67 67
     }
68 68
 
@@ -78,17 +78,17 @@  discard block
 block discarded – undo
78 78
         $this->app->offsetUnset('translation.loader');
79 79
         $this->app->offsetUnset('translator');
80 80
 
81
-        $this->app->singleton('translation.loader', function ($app) {
82
-            return new TranslationLoader($app['files'], $app['path.lang']);
81
+        $this->app->singleton('translation.loader', function($app) {
82
+            return new TranslationLoader($app[ 'files' ], $app[ 'path.lang' ]);
83 83
         });
84
-        $this->app->singleton('translator', function ($app) {
85
-            $loader = $app['translation.loader'];
84
+        $this->app->singleton('translator', function($app) {
85
+            $loader = $app[ 'translation.loader' ];
86 86
 
87
-            $locale = $app['config']['app.locale'];
87
+            $locale = $app[ 'config' ][ 'app.locale' ];
88 88
 
89 89
             $trans = new Translator($loader, $locale);
90 90
 
91
-            $trans->setFallback($app['config']['app.fallback_locale']);
91
+            $trans->setFallback($app[ 'config' ][ 'app.fallback_locale' ]);
92 92
 
93 93
             return $trans;
94 94
         });
@@ -96,12 +96,12 @@  discard block
 block discarded – undo
96 96
 
97 97
     private function registerValidators()
98 98
     {
99
-        Validator::extend('extensions', function ($attribute, $value, $parameters) {
99
+        Validator::extend('extensions', function($attribute, $value, $parameters) {
100 100
             return in_array($value->getClientOriginalExtension(), $parameters);
101 101
         });
102 102
 
103
-        Validator::replacer('extensions', function ($message, $attribute, $rule, $parameters) {
104
-            return str_replace([':attribute', ':values'], [$attribute, implode(',', $parameters)], $message);
103
+        Validator::replacer('extensions', function($message, $attribute, $rule, $parameters) {
104
+            return str_replace([ ':attribute', ':values' ], [ $attribute, implode(',', $parameters) ], $message);
105 105
         });
106 106
     }
107 107
 }
Please login to merge, or discard this patch.