Completed
Push — master ( bc672a...0fd399 )
by Blaž
02:36
created
src/TranslatableScope.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
      */
89 89
     protected function getJoinClause(Eloquent $model, $locale, $alias)
90 90
     {
91
-        return function (JoinClause $join) use ($model, $locale, $alias) {
91
+        return function(JoinClause $join) use ($model, $locale, $alias) {
92 92
             $primary = $model->getKeyName();
93 93
             $foreign = $model->getForeignKey();
94 94
             $langKey = $model->getLocaleKey();
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      */
144 144
     protected function formatColumns(EloquentBuilder $builder, Eloquent $model)
145 145
     {
146
-        $map = function ($field) use ($builder, $model) {
146
+        $map = function($field) use ($builder, $model) {
147 147
             if (!$model->shouldFallback()) {
148 148
                 return "{$this->i18nTable}.{$field}";
149 149
             }
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
      */
178 178
     public function extend(EloquentBuilder $builder)
179 179
     {
180
-        $builder->macro('onlyTranslated', function (EloquentBuilder $builder, $locale = null) {
180
+        $builder->macro('onlyTranslated', function(EloquentBuilder $builder, $locale = null) {
181 181
             $builder->getModel()->setOnlyTranslated(true);
182 182
 
183 183
             if ($locale) {
@@ -187,13 +187,13 @@  discard block
 block discarded – undo
187 187
             return $builder;
188 188
         });
189 189
 
190
-        $builder->macro('withUntranslated', function (EloquentBuilder $builder) {
190
+        $builder->macro('withUntranslated', function(EloquentBuilder $builder) {
191 191
             $builder->getModel()->setOnlyTranslated(false);
192 192
 
193 193
             return $builder;
194 194
         });
195 195
 
196
-        $builder->macro('withFallback', function (EloquentBuilder $builder, $fallbackLocale = null) {
196
+        $builder->macro('withFallback', function(EloquentBuilder $builder, $fallbackLocale = null) {
197 197
             $builder->getModel()->setWithFallback(true);
198 198
 
199 199
             if ($fallbackLocale) {
@@ -203,13 +203,13 @@  discard block
 block discarded – undo
203 203
             return $builder;
204 204
         });
205 205
 
206
-        $builder->macro('withoutFallback', function (EloquentBuilder $builder) {
206
+        $builder->macro('withoutFallback', function(EloquentBuilder $builder) {
207 207
             $builder->getModel()->setWithFallback(false);
208 208
 
209 209
             return $builder;
210 210
         });
211 211
 
212
-        $builder->macro('translateInto', function (EloquentBuilder $builder, $locale) {
212
+        $builder->macro('translateInto', function(EloquentBuilder $builder, $locale) {
213 213
             if ($locale) {
214 214
                 $builder->getModel()->setLocale($locale);
215 215
             }
@@ -217,13 +217,13 @@  discard block
 block discarded – undo
217 217
             return $builder;
218 218
         });
219 219
 
220
-        $builder->macro('withoutTranslations', function (EloquentBuilder $builder) {
220
+        $builder->macro('withoutTranslations', function(EloquentBuilder $builder) {
221 221
             $builder->withoutGlobalScope(static::class);
222 222
 
223 223
             return $builder;
224 224
         });
225 225
 
226
-        $builder->macro('withAllTranslations', function (EloquentBuilder $builder) {
226
+        $builder->macro('withAllTranslations', function(EloquentBuilder $builder) {
227 227
             $builder->withoutGlobalScope(static::class)->with('translations');
228 228
 
229 229
             return $builder;
Please login to merge, or discard this patch.
src/Translatable.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
     {
81 81
         $model = new static;
82 82
 
83
-        return static::unguarded(function () use ($model, $attributes, $translations) {
83
+        return static::unguarded(function() use ($model, $attributes, $translations) {
84 84
             return $model->create($attributes, $translations);
85 85
         });
86 86
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
     {
98 98
         $model = new static;
99 99
 
100
-        return static::unguarded(function () use ($locale, $model, $attributes, $translations) {
100
+        return static::unguarded(function() use ($locale, $model, $attributes, $translations) {
101 101
             return $model->createInLocale($locale, $attributes, $translations);
102 102
         });
103 103
     }
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     public function forceSaveTranslations(array $translations)
159 159
     {
160
-        return static::unguarded(function () use ($translations) {
160
+        return static::unguarded(function() use ($translations) {
161 161
             return $this->saveTranslations($translations);
162 162
         });
163 163
     }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
      */
188 188
     public function forceSaveTranslation($locale, array $attributes)
189 189
     {
190
-        return static::unguarded(function () use ($locale, $attributes) {
190
+        return static::unguarded(function() use ($locale, $attributes) {
191 191
             return $this->saveTranslation($locale, $attributes);
192 192
         });
193 193
     }
Please login to merge, or discard this patch.
src/QueryBuilder.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     {
59 59
         $column = $this->qualifyColumns(is_array($column) ? $column : func_get_args());
60 60
 
61
-        $this->columns = array_merge((array)$this->columns, $column);
61
+        $this->columns = array_merge((array) $this->columns, $column);
62 62
 
63 63
         return $this;
64 64
     }
@@ -282,8 +282,7 @@  discard block
 block discarded – undo
282 282
             $suffix = $this->model->getTranslationTableSuffix();
283 283
 
284 284
             return Str::endsWith($alias, $suffix) ?
285
-                "{$table}{$fallback}.{$field}" :
286
-                "{$table}{$suffix}{$fallback}.{$field}";
285
+                "{$table}{$fallback}.{$field}" : "{$table}{$suffix}{$fallback}.{$field}";
287 286
         }
288 287
 
289 288
         return "{$alias}{$fallback}.{$column}";
Please login to merge, or discard this patch.
src/TranslatableServiceProvider.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -11,19 +11,19 @@
 block discarded – undo
11 11
      */
12 12
     public function register()
13 13
     {
14
-        TranslatableConfig::cacheGetter(function ($table) {
14
+        TranslatableConfig::cacheGetter(function($table) {
15 15
             return $this->app['cache']->get('translatable.' . $table);
16 16
         });
17 17
 
18
-        TranslatableConfig::cacheSetter(function ($table, $fields) {
18
+        TranslatableConfig::cacheSetter(function($table, $fields) {
19 19
             return $this->app['cache']->forever('translatable.' . $table, $fields);
20 20
         });
21 21
 
22
-        TranslatableConfig::currentLocaleGetter(function () {
22
+        TranslatableConfig::currentLocaleGetter(function() {
23 23
             return $this->app->getLocale();
24 24
         });
25 25
 
26
-        TranslatableConfig::fallbackLocaleGetter(function () {
26
+        TranslatableConfig::fallbackLocaleGetter(function() {
27 27
             return method_exists($this->app, 'getFallbackLocale')
28 28
                 ? $this->app->getFallbackLocale()
29 29
                 : config('app.fallback_locale');
Please login to merge, or discard this patch.