Completed
Push — master ( 018ca8...879ee7 )
by Владислав
07:36 queued 05:24
created
tests/DeCaptchaAbstractTest.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function testGetBaseUrl()
20 20
     {
21 21
         $abstract = $this->newInstance();
22
-        $getBaseUrlCaller = function () {
22
+        $getBaseUrlCaller = function() {
23 23
             $this->domain = 'domain';
24 24
             return $this->getBaseUrl();
25 25
         };
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
     public function testGetFilePath()
52 52
     {
53 53
         $abstract = $this->newInstance();
54
-        $getFilePathCaller = function ($val) {
54
+        $getFilePathCaller = function($val) {
55 55
             return $this->getFilePath($val);
56 56
         };
57 57
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
58
-        $this->assertEquals(__DIR__.'/data/Captcha.jpg', $bound(__DIR__.'/data/Captcha.jpg'));
58
+        $this->assertEquals(__DIR__ . '/data/Captcha.jpg', $bound(__DIR__ . '/data/Captcha.jpg'));
59 59
         $filePathUpload = $bound('https://upload.wikimedia.org/wikipedia/commons/6/69/Captcha.jpg');
60
-        $file1 = file_get_contents(__DIR__.'/data/Captcha.jpg');
60
+        $file1 = file_get_contents(__DIR__ . '/data/Captcha.jpg');
61 61
         $file2 = file_get_contents($filePathUpload);
62 62
         $this->assertEquals($file1, $file2);
63 63
     }
@@ -69,11 +69,11 @@  discard block
 block discarded – undo
69 69
     public function testGetFilePathErrorFileNotFound()
70 70
     {
71 71
         $abstract = $this->newInstance();
72
-        $getFilePathCaller = function ($val) {
72
+        $getFilePathCaller = function($val) {
73 73
             return $this->getFilePath($val);
74 74
         };
75 75
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
76
-        $bound(__DIR__.'/data/Captcha1.jpg');
76
+        $bound(__DIR__ . '/data/Captcha1.jpg');
77 77
     }
78 78
 
79 79
     /**
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     public function testGetFilePathErrorFileIsNotLoaded()
85 85
     {
86 86
         $abstract = $this->newInstance();
87
-        $getFilePathCaller = function ($val) {
87
+        $getFilePathCaller = function($val) {
88 88
             return $this->getFilePath($val);
89 89
         };
90 90
         $bound = $getFilePathCaller->bindTo($abstract, $abstract);
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
     public function testIsError()
158 158
     {
159 159
         $abstract = $this->newInstance();
160
-        $isErrorCaller = function ($val) {
160
+        $isErrorCaller = function($val) {
161 161
             return $this->isError($val);
162 162
         };
163 163
         $bound = $isErrorCaller->bindTo($abstract, $abstract);
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     public function testIsErrorNot()
168 168
     {
169 169
         $abstract = $this->newInstance();
170
-        $isErrorCaller = function ($val) {
170
+        $isErrorCaller = function($val) {
171 171
             return $this->isError($val);
172 172
         };
173 173
         $bound = $isErrorCaller->bindTo($abstract, $abstract);
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
     public function testGetCurlResponseError()
183 183
     {
184 184
         $abstract = $this->newInstance();
185
-        $getCurlResponseCaller = function ($url, $val) {
185
+        $getCurlResponseCaller = function($url, $val) {
186 186
             return $this->getCurlResponse($url, $val);
187 187
         };
188 188
         $bound = $getCurlResponseCaller->bindTo($abstract, $abstract);
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
     public function testGetCurlResponse()
193 193
     {
194 194
         $abstract = $this->newInstance();
195
-        $getCurlResponseCaller = function ($url, $val) {
195
+        $getCurlResponseCaller = function($url, $val) {
196 196
             return $this->getCurlResponse($url, $val);
197 197
         };
198 198
         $bound = $getCurlResponseCaller->bindTo($abstract, $abstract);
Please login to merge, or discard this patch.
src/core/DeCaptchaAbstract.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -96,8 +96,7 @@  discard block
 block discarded – undo
96 96
         }
97 97
         $decodeSetting = $this->decodeSettings[static::DECODE_ACTION][$action];
98 98
         $decodeFormat = array_key_exists(static::DECODE_FORMAT, $decodeSetting) ?
99
-            $decodeSetting[static::DECODE_FORMAT] :
100
-            $this->decodeSettings[static::DECODE_FORMAT];
99
+            $decodeSetting[static::DECODE_FORMAT] : $this->decodeSettings[static::DECODE_FORMAT];
101 100
         $values = [];
102 101
         switch ($decodeFormat) {
103 102
             case static::RESPONSE_TYPE_STRING:
@@ -158,7 +157,7 @@  discard block
 block discarded – undo
158 157
      */
159 158
     protected function getActionUrl($action)
160 159
     {
161
-        return $this->getBaseUrl().$this->actions[$action][static::ACTION_URI];
160
+        return $this->getBaseUrl() . $this->actions[$action][static::ACTION_URI];
162 161
     }
163 162
 
164 163
     /**
@@ -201,7 +200,7 @@  discard block
 block discarded – undo
201 200
         }
202 201
         switch ($param) {
203 202
             case static::PARAM_SPEC_FILE:
204
-                return (version_compare(PHP_VERSION, '5.5.0') >= 0) ? new \CURLFile($this->params[$param]) : '@'.$this->params[$param];
203
+                return (version_compare(PHP_VERSION, '5.5.0') >= 0) ? new \CURLFile($this->params[$param]) : '@' . $this->params[$param];
205 204
             case static::PARAM_SPEC_KEY:
206 205
                 return is_callable($this->params[$param]) ? $this->params[$param]() : $this->params[$param];
207 206
             case static::PARAM_SPEC_CAPTCHA:
@@ -301,7 +300,7 @@  discard block
 block discarded – undo
301 300
             foreach ($data as $key => $value) {
302 301
                 $uri[] = "$key=$value";
303 302
             }
304
-            $url .= '?'.implode('&', $uri);
303
+            $url .= '?' . implode('&', $uri);
305 304
         }
306 305
         curl_setopt($ch, CURLOPT_URL, $url);
307 306
         if (version_compare(PHP_VERSION, '5.5.0') >= 0 && version_compare(PHP_VERSION, '7.0') < 0 && defined('CURLOPT_SAFE_UPLOAD')) {
Please login to merge, or discard this patch.
tests/RucaptchaTest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
         $re = new \jumper423\decaptcha\services\TwoCaptcha([
11 11
             \jumper423\decaptcha\services\TwoCaptcha::PARAM_SPEC_KEY => 'b7e7f1002f0f917ca5a852e1c0312e8f',
12 12
         ]);
13
-        if ($re->recognize(__DIR__.'/data/Captcha.jpg')) {
13
+        if ($re->recognize(__DIR__ . '/data/Captcha.jpg')) {
14 14
             $this->assertEquals('11111111111111', $re->getCode());
15 15
         } else {
16 16
             $this->assertEquals('22222222222222', $re->getError());
Please login to merge, or discard this patch.