Completed
Pull Request — master (#145)
by
unknown
01:14
created
src/GoogleTranslate.php 2 patches
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.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -224,7 +224,9 @@
 block discarded – undo
224 224
          * if source lang and target lang are the same
225 225
          * just return the string without any request to google
226 226
          */
227
-        if ($this->source == $this->target) return $string;
227
+        if ($this->source == $this->target) {
228
+         return $string;
229
+        }
228 230
         
229 231
         $responseArray = $this->getResponse($string);
230 232
 
Please login to merge, or discard this patch.
src/Tokens/GoogleTokenGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
         }
84 84
         $text = fmod($text, pow(10, 6));
85 85
         
86
-        $this->tokens[$hash] = $text . '.' . ($text ^ $b);
86
+        $this->tokens[$hash] = $text.'.'.($text ^ $b);
87 87
         
88 88
         return $this->tokens[$hash];
89 89
     }
Please login to merge, or discard this patch.