Completed
Pull Request — master (#143)
by
unknown
01:13
created
src/Tokens/GoogleTokenGenerator.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
      * http://stackoverflow.com/a/43359819/2953830
106 106
      *
107 107
      * @param $a
108
-     * @param $b
108
+     * @param integer $b
109 109
      *
110 110
      * @return number
111 111
      */
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @param string $str
143 143
      * @param int    $index
144 144
      *
145
-     * @return number
145
+     * @return string
146 146
      */
147 147
     private function JS_charCodeAt($str, $index) {
148 148
         $utf16 = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 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
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
      */
148 148
     private function JS_charCodeAt($str, $index) {
149 149
         $utf16 = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
150
-        return ord($utf16[$index*2]) + (ord($utf16[$index*2+1]) << 8);
150
+        return ord($utf16[$index * 2]) + (ord($utf16[$index * 2 + 1]) << 8);
151 151
     }
152 152
 
153 153
     /**
@@ -159,6 +159,6 @@  discard block
 block discarded – undo
159 159
      */
160 160
     private function JS_length($str) {
161 161
         $utf16 = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
162
-        return strlen($utf16)/2;
162
+        return strlen($utf16) / 2;
163 163
     }
164 164
 }
Please login to merge, or discard this patch.
src/GoogleTranslate.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,6 @@
 block discarded – undo
2 2
 
3 3
 namespace Stichoza\GoogleTranslate;
4 4
 
5
-use BadMethodCallException;
6 5
 use ErrorException;
7 6
 use GuzzleHttp\Client;
8 7
 use GuzzleHttp\Exception\RequestException;
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -91,15 +91,15 @@  discard block
 block discarded – undo
91 91
     protected const QUERY = [
92 92
         'client'   => 'webapp',
93 93
         'dt'       => [
94
-            't',   // Translate
95
-            'bd',  // Full translate with synonym ($bodyArray[1])
96
-            'at',  // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word)
97
-            'ex',  // Example part ($bodyArray[13])
98
-            'ld',  // I don't know ($bodyArray[8])
99
-            'md',  // Definition part with example ($bodyArray[12])
94
+            't', // Translate
95
+            'bd', // Full translate with synonym ($bodyArray[1])
96
+            'at', // Other translate ($bodyArray[5] - in google translate page this shows when click on translated word)
97
+            'ex', // Example part ($bodyArray[13])
98
+            'ld', // I don't know ($bodyArray[8])
99
+            'md', // Definition part with example ($bodyArray[12])
100 100
             'qca', // I don't know ($bodyArray[8])
101
-            'rw',  // Read also part ($bodyArray[14])
102
-            'rm',  // I don't know
101
+            'rw', // Read also part ($bodyArray[14])
102
+            'rm', // I don't know
103 103
             'ss'   // Full synonym ($bodyArray[11])
104 104
         ],
105 105
         'ie'       => 'UTF-8', // Input encoding
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
         }
299 299
 
300 300
         // Check if translation exists
301
-        if (! $response || empty($response[0])) {
301
+        if (!$response || empty($response[0])) {
302 302
             return null;
303 303
         }
304 304
 
Please login to merge, or discard this patch.