Test Failed
Push — master ( 2372d4...13c287 )
by Ricardo
05:08
created
src/Translation.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         try {
192 192
             return app()->getLocale();
193 193
         } catch (Exception $e) {
194
-            if($this->request->request->has('locale')){
194
+            if ($this->request->request->has('locale')) {
195 195
                 return strtolower($this->request->input('locale'));
196 196
             }
197 197
             if ($this->request->hasHeader('locale')) {
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
             if ($this->request->hasSession() and $this->request->session()->has('locale')) {
204 204
                 return $this->request->session()->get('locale');
205 205
             }
206
-            if ($locale = substr($this->request->server('HTTP_ACCEPT_LANGUAGE'), 0, 2) and in_array($locale, config('translation.locales'))){
206
+            if ($locale = substr($this->request->server('HTTP_ACCEPT_LANGUAGE'), 0, 2) and in_array($locale, config('translation.locales'))) {
207 207
                 return $locale;
208 208
             }
209 209
             return $this->getConfigDefaultLocale();
@@ -657,7 +657,7 @@  discard block
 block discarded – undo
657 657
      * Detects the Default Locale Based on
658 658
      */
659 659
 
660
-    public function detectLocale($request){
660
+    public function detectLocale($request) {
661 661
         if (!$request->hasCookie('locale')) {
662 662
             $locale = substr($request->server('HTTP_ACCEPT_LANGUAGE'), 0, 2);
663 663
 
Please login to merge, or discard this patch.
src/Tokens/GoogleTokenGenerator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     private function unsignedRightShift($a, $b)
113 113
     {
114 114
         if ($b >= 32 || $b < -32) {
115
-            $m = (int)($b / 32);
115
+            $m = (int) ($b / 32);
116 116
             $b = $b - ($m * 32);
117 117
         }
118 118
 
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
      */
147 147
     private function JS_charCodeAt($str, $index) {
148 148
         $utf16 = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
149
-        return ord($utf16[$index*2]) + (ord($utf16[$index*2+1]) << 8);
149
+        return ord($utf16[$index * 2]) + (ord($utf16[$index * 2 + 1]) << 8);
150 150
     }
151 151
 
152 152
     /**
@@ -158,6 +158,6 @@  discard block
 block discarded – undo
158 158
      */
159 159
     private function JS_length($str) {
160 160
         $utf16 = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
161
-        return strlen($utf16)/2;
161
+        return strlen($utf16) / 2;
162 162
     }
163 163
 }
Please login to merge, or discard this patch.
src/GoogleTranslate.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
         'client'   => 'webapp',
57 57
         'hl'       => 'en',
58 58
         'dt'       => [
59
-            't',   // Translate
60
-            'bd',  // Full translate with synonym ($bodyArray[1])
61
-            'at',  // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word)
62
-            'ex',  // Example part ($bodyArray[13])
63
-            'ld',  // I don't know ($bodyArray[8])
64
-            'md',  // Definition part with example ($bodyArray[12])
59
+            't', // Translate
60
+            'bd', // Full translate with synonym ($bodyArray[1])
61
+            'at', // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word)
62
+            'ex', // Example part ($bodyArray[13])
63
+            'ld', // I don't know ($bodyArray[8])
64
+            'md', // Definition part with example ($bodyArray[12])
65 65
             'qca', // I don't know ($bodyArray[8])
66
-            'rw',  // Read also part ($bodyArray[14])
67
-            'rm',  // I don't know
66
+            'rw', // Read also part ($bodyArray[14])
67
+            'rm', // I don't know
68 68
             'ss'   // Full synonym ($bodyArray[11])
69 69
         ],
70 70
         'sl'       => null, // Source language
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
             return $responseArray;
270 270
         } else {
271 271
             if (is_array($responseArray[0])) {
272
-                return (string) array_reduce($responseArray[0], function ($carry, $item) {
272
+                return (string) array_reduce($responseArray[0], function($carry, $item) {
273 273
                     $carry .= $item[0];
274 274
                     return $carry;
275 275
                 });
Please login to merge, or discard this patch.
src/Traits/Translatable.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@
 block discarded – undo
50 50
             if (!$this->translationCodeFor($attribute)) {
51 51
                 $reflected                                    = new \ReflectionClass($this);
52 52
                 $group                                        = 'translatable';
53
-                $item                                         = strtolower($reflected->getShortName()) . '.' . strtolower($attribute) . '.' . Str::random();
53
+                $item                                         = strtolower($reflected->getShortName()).'.'.strtolower($attribute).'.'.Str::random();
54 54
                 $this->attributes["{$attribute}_translation"] = "$group.$item";
55 55
             }
56 56
         }
Please login to merge, or discard this patch.
src/Repositories/TranslationRepository.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             ->whereGroup($group)
238 238
             ->get()
239 239
             ->keyBy('item')
240
-            ->map(function ($translation) {
240
+            ->map(function($translation) {
241 241
                 return $translation['text'];
242 242
             })
243 243
             ->toArray();
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         $elements = explode('.', $partialCode);
282 282
         foreach ($elements as $element) {
283 283
             if ($element) {
284
-                $query = $query->where(function ($query) use ($element) {
284
+                $query = $query->where(function($query) use ($element) {
285 285
                     $query->where('group', 'like', "%{$element}%")->orWhere('item', 'like', "%{$element}%")->orWhere('text', 'like', "%{$element}%");
286 286
                 });
287 287
             }
@@ -361,9 +361,9 @@  discard block
 block discarded – undo
361 361
 
362 362
         return $this->model
363 363
             ->newQuery()
364
-            ->select($table . '.text')
364
+            ->select($table.'.text')
365 365
             ->from($table)
366
-            ->leftJoin("{$table} as e", function ($join) use ($table, $text, $textLocale) {
366
+            ->leftJoin("{$table} as e", function($join) use ($table, $text, $textLocale) {
367 367
                 $join->on('e.namespace', '=', "{$table}.namespace")
368 368
                     ->on('e.group', '=', "{$table}.group")
369 369
                     ->on('e.item', '=', "{$table}.item");
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
 
467 467
         return $this->database->table("$table as $table")
468 468
             ->select("$table.id")
469
-            ->leftJoin("$table as e", function (JoinClause $query) use ($table, $locale) {
469
+            ->leftJoin("$table as e", function(JoinClause $query) use ($table, $locale) {
470 470
                 $query->on('e.namespace', '=', "$table.namespace")
471 471
                     ->on('e.group', '=', "$table.group")
472 472
                     ->on('e.item', '=', "$table.item")
Please login to merge, or discard this patch.
src/Commands/FileLoaderCommand.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -106,8 +106,8 @@  discard block
 block discarded – undo
106 106
         // Load all files inside subdirectories:
107 107
         $directories = $this->files->directories($path);
108 108
         foreach ($directories as $directory) {
109
-            $directoryName = str_replace($path . '/', '', $directory);
110
-            $dirGroup      = $group . basename($directory) . '/';
109
+            $directoryName = str_replace($path.'/', '', $directory);
110
+            $dirGroup      = $group.basename($directory).'/';
111 111
             $this->loadDirectory($directory, $locale, $namespace, $dirGroup);
112 112
         }
113 113
 
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     public function loadFile($file, $locale, $namespace = '*', $group = '')
131 131
     {
132
-        $group        = $group . basename($file, '.php');
132
+        $group        = $group.basename($file, '.php');
133 133
         $translations = $this->files->getRequire($file);
134 134
         $this->translationRepository->loadArray($translations, $locale, $group, $namespace, $locale == $this->defaultLocale);
135 135
     }
Please login to merge, or discard this patch.
src/Commands/CacheFlushCommand.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,8 +52,8 @@
 block discarded – undo
52 52
      * Execute the console command for Laravel 5.5
53 53
      * this laravel version call handle intead of fire
54 54
      */
55
-     public function handle()
56
-     {
57
-         $this->fire();
58
-     }
55
+        public function handle()
56
+        {
57
+            $this->fire();
58
+        }
59 59
 }
Please login to merge, or discard this patch.
src/UriLocalizer.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -109,7 +109,7 @@
 block discarded – undo
109 109
      */
110 110
     protected function pathFromParsedUrl($parsedUrl)
111 111
     {
112
-        $path = '/' . implode('/', $parsedUrl['segments']);
112
+        $path = '/'.implode('/', $parsedUrl['segments']);
113 113
         if ($parsedUrl['query']) {
114 114
             $path .= "?{$parsedUrl['query']}";
115 115
         }
Please login to merge, or discard this patch.
src/Routes/ResourceRegistrar.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 
42 42
         // Remove segments from group prefix that are equal to one of the available locales:
43 43
         $groupSegments = explode('/', $this->router->getLastGroupPrefix());
44
-        $groupSegments = array_filter($groupSegments, function ($segment) use ($availableLocales) {
44
+        $groupSegments = array_filter($groupSegments, function($segment) use ($availableLocales) {
45 45
             return !in_array($segment, $availableLocales);
46 46
         });
47 47
         $group = trim(implode('.', $groupSegments), '.');
Please login to merge, or discard this patch.