Completed
Push — master ( 132934...c8ddaf )
by Nicolas
04:39
created
Entities/TranslationTranslation.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 {
11 11
     use RevisionableTrait;
12 12
     public $timestamps = false;
13
-    protected $fillable = ['value'];
13
+    protected $fillable = [ 'value' ];
14 14
     protected $table = 'translation__translation_translations';
15 15
 
16 16
     protected $revisionEnabled = true;
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     protected $historyLimit = 100;
19 19
     protected $revisionCreationsEnabled = true;
20 20
 
21
-    public function __construct(array $attributes = [])
21
+    public function __construct(array $attributes = [ ])
22 22
     {
23 23
         parent::__construct($attributes);
24 24
         $this->historyLimit = config('asgard.translation.config.revision-history-limit', 100);
Please login to merge, or discard this patch.
Http/Controllers/Api/TranslationController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
         $translation = $translation->translate($request->get('locale'));
38 38
 
39 39
         if (null === $translation) {
40
-            return response()->json(['<tr><td>' . trans('translation::translations.No Revisions yet') . '</td></tr>']);
40
+            return response()->json([ '<tr><td>' . trans('translation::translations.No Revisions yet') . '</td></tr>' ]);
41 41
         }
42 42
 
43 43
         return response()->json($this->formatRevisionHistory($translation->revisionHistory));
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
 
46 46
     private function formatRevisionHistory(Collection $revisionHistory)
47 47
     {
48
-        $formattedHistory = [];
48
+        $formattedHistory = [ ];
49 49
 
50 50
         foreach ($revisionHistory as $history) {
51 51
             if ($history->key == 'created_at' && !$history->old_value) {
52
-                $formattedHistory[] = $this->getCreatedRevisionTemplate($history);
52
+                $formattedHistory[ ] = $this->getCreatedRevisionTemplate($history);
53 53
             } else {
54
-                $formattedHistory[] = $this->getRevisionTemplate($history);
54
+                $formattedHistory[ ] = $this->getRevisionTemplate($history);
55 55
             }
56 56
         }
57 57
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
     private function getRevisionTemplate($history)
62 62
     {
63 63
         $timeAgo = $history->created_at->diffForHumans();
64
-        $revertRoute = route('admin.translation.translation.update', [$history->revisionable_id, 'oldValue' => $history->oldValue()]);
64
+        $revertRoute = route('admin.translation.translation.update', [ $history->revisionable_id, 'oldValue' => $history->oldValue() ]);
65 65
         $edited = trans('translation::translations.edited');
66 66
         return <<<HTML
67 67
 <tr>
Please login to merge, or discard this patch.
Providers/TranslationServiceProvider.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,18 +78,18 @@  discard block
 block discarded – undo
78 78
 
79 79
     private function registerBindings()
80 80
     {
81
-        $this->app->bind(TranslationRepository::class, function () {
81
+        $this->app->bind(TranslationRepository::class, function() {
82 82
             $repository = new EloquentTranslationRepository(new Translation());
83 83
 
84
-            if (! config('app.cache')) {
84
+            if (!config('app.cache')) {
85 85
                 return $repository;
86 86
             }
87 87
 
88 88
             return new CacheTranslationDecorator($repository);
89 89
         });
90 90
 
91
-        $this->app->bind(FileTranslationRepository::class, function ($app) {
92
-            return new FileDiskTranslationRepository($app['files'], $app['translation.loader']);
91
+        $this->app->bind(FileTranslationRepository::class, function($app) {
92
+            return new FileDiskTranslationRepository($app[ 'files' ], $app[ 'translation.loader' ]);
93 93
         });
94 94
     }
95 95
 
@@ -105,17 +105,17 @@  discard block
 block discarded – undo
105 105
         $this->app->offsetUnset('translation.loader');
106 106
         $this->app->offsetUnset('translator');
107 107
 
108
-        $this->app->singleton('translation.loader', function ($app) {
109
-            return new TranslationLoader($app['files'], $app['path.lang']);
108
+        $this->app->singleton('translation.loader', function($app) {
109
+            return new TranslationLoader($app[ 'files' ], $app[ 'path.lang' ]);
110 110
         });
111
-        $this->app->singleton('translator', function ($app) {
112
-            $loader = $app['translation.loader'];
111
+        $this->app->singleton('translator', function($app) {
112
+            $loader = $app[ 'translation.loader' ];
113 113
 
114
-            $locale = $app['config']['app.locale'];
114
+            $locale = $app[ 'config' ][ 'app.locale' ];
115 115
 
116 116
             $trans = new Translator($loader, $locale);
117 117
 
118
-            $trans->setFallback($app['config']['app.fallback_locale']);
118
+            $trans->setFallback($app[ 'config' ][ 'app.fallback_locale' ]);
119 119
 
120 120
             return $trans;
121 121
         });
@@ -123,12 +123,12 @@  discard block
 block discarded – undo
123 123
 
124 124
     private function registerValidators()
125 125
     {
126
-        Validator::extend('extensions', function ($attribute, $value, $parameters) {
126
+        Validator::extend('extensions', function($attribute, $value, $parameters) {
127 127
             return in_array($value->getClientOriginalExtension(), $parameters);
128 128
         });
129 129
 
130
-        Validator::replacer('extensions', function ($message, $attribute, $rule, $parameters) {
131
-            return str_replace([':attribute', ':values'], [$attribute, implode(',', $parameters)], $message);
130
+        Validator::replacer('extensions', function($message, $attribute, $rule, $parameters) {
131
+            return str_replace([ ':attribute', ':values' ], [ $attribute, implode(',', $parameters) ], $message);
132 132
         });
133 133
     }
134 134
 }
Please login to merge, or discard this patch.