Completed
Pull Request — master (#93)
by
unknown
01:35
created
src/Stichoza/GoogleTranslate/TranslateClient.php 2 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -213,7 +213,6 @@
 block discarded – undo
213 213
     /**
214 214
      * Set the api we are used to translete.
215 215
      *
216
-     * @param string $source Google translate api, default is https://translate.google.com/translate_a/single
217 216
      *
218 217
      * @return TranslateClient
219 218
      */
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -70,15 +70,15 @@  discard block
 block discarded – undo
70 70
         'client'   => 't',
71 71
         'hl'       => 'en',
72 72
         'dt'       => [
73
-            't',   // Translate
74
-            'bd',  // Full translate with synonym ($bodyArray[1])
75
-            'at',  // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word)
76
-            'ex',  // Example part ($bodyArray[13])
77
-            'ld',  // I don't know ($bodyArray[8])
78
-            'md',  // Definition part with example ($bodyArray[12])
73
+            't', // Translate
74
+            'bd', // Full translate with synonym ($bodyArray[1])
75
+            'at', // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word)
76
+            'ex', // Example part ($bodyArray[13])
77
+            'ld', // I don't know ($bodyArray[8])
78
+            'md', // Definition part with example ($bodyArray[12])
79 79
             'qca', // I don't know ($bodyArray[8])
80
-            'rw',  // Read also part ($bodyArray[14])
81
-            'rm',  // I don't know
80
+            'rw', // Read also part ($bodyArray[14])
81
+            'rm', // I don't know
82 82
             'ss'   // Full synonym ($bodyArray[11])
83 83
         ],
84 84
         'sl'       => null, // Source language
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
             return $responseArray;
432 432
         } else {
433 433
             if (is_array($responseArray[0])) {
434
-                return array_reduce($responseArray[0], function ($carry, $item) {
434
+                return array_reduce($responseArray[0], function($carry, $item) {
435 435
                     $carry .= $item[0];
436 436
 
437 437
                     return $carry;
Please login to merge, or discard this patch.
src/Stichoza/GoogleTranslate/Tokens/GoogleTokenGenerator.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
      * @param string $target Target language
18 18
      * @param string $text   Text to translate
19 19
      *
20
-     * @return mixed A token
20
+     * @return string A token
21 21
      */
22 22
     public function generateToken($source, $target, $text)
23 23
     {
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      * http://stackoverflow.com/a/43359819/2953830
107 107
      *
108 108
      * @param $a
109
-     * @param $b
109
+     * @param integer $b
110 110
      *
111 111
      * @return number
112 112
      */
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
      * @param string $str
144 144
      * @param int    $index
145 145
      *
146
-     * @return null|number
146
+     * @return string
147 147
      */
148 148
     private function charCodeAt($str, $index)
149 149
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@
 block discarded – undo
113 113
     private function unsignedRightShift($a, $b)
114 114
     {
115 115
         if ($b >= 32 || $b < -32) {
116
-            $m = (int)($b / 32);
116
+            $m = (int) ($b / 32);
117 117
             $b = $b - ($m * 32);
118 118
         }
119 119
 
Please login to merge, or discard this patch.