Completed
Push — master ( a968dc...d439da )
by Владислав
02:39
created
src/core/DeCaptchaAbstract.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -102,8 +102,7 @@  discard block
 block discarded – undo
102 102
         }
103 103
         $decodeSetting = $this->decodeSettings[static::DECODE_ACTION][$action];
104 104
         $decodeFormat = array_key_exists(static::DECODE_FORMAT, $decodeSetting) ?
105
-            $decodeSetting[static::DECODE_FORMAT] :
106
-            $this->decodeSettings[static::DECODE_FORMAT];
105
+            $decodeSetting[static::DECODE_FORMAT] : $this->decodeSettings[static::DECODE_FORMAT];
107 106
         $values = [];
108 107
         switch ($decodeFormat) {
109 108
             case static::RESPONSE_TYPE_STRING:
@@ -180,7 +179,7 @@  discard block
 block discarded – undo
180 179
      */
181 180
     protected function getActionUrl($action)
182 181
     {
183
-        return $this->getBaseUrl().$this->actions[$action][static::ACTION_URI];
182
+        return $this->getBaseUrl() . $this->actions[$action][static::ACTION_URI];
184 183
     }
185 184
 
186 185
     /**
@@ -237,7 +236,7 @@  discard block
 block discarded – undo
237 236
                         return base64_encode(file_get_contents($this->params[$param]));
238 237
                 }
239 238
 
240
-                return (version_compare(PHP_VERSION, '5.5.0') >= 0) ? new \CURLFile($this->getFilePath($this->params[$param])) : '@'.$this->getFilePath($this->params[$param]);
239
+                return (version_compare(PHP_VERSION, '5.5.0') >= 0) ? new \CURLFile($this->getFilePath($this->params[$param])) : '@' . $this->getFilePath($this->params[$param]);
241 240
             case static::PARAM_SPEC_API_KEY:
242 241
                 return is_callable($this->params[$param]) ? $this->params[$param]() : $this->params[$param];
243 242
             case static::PARAM_SPEC_CAPTCHA:
@@ -300,7 +299,7 @@  discard block
 block discarded – undo
300 299
                         break;
301 300
                 }
302 301
                 if (array_key_exists(self::PARAM_SLUG_ENUM, $settings) && !in_array($value, $settings[static::PARAM_SLUG_ENUM])) {
303
-                    throw new DeCaptchaErrors(DeCaptchaErrors::ERROR_PARAM_ENUM, (array_key_exists($field, $this->paramsNames) ? $this->paramsNames[$field] : $field).' = '.$value, $this->errorLang);
302
+                    throw new DeCaptchaErrors(DeCaptchaErrors::ERROR_PARAM_ENUM, (array_key_exists($field, $this->paramsNames) ? $this->paramsNames[$field] : $field) . ' = ' . $value, $this->errorLang);
304 303
                 }
305 304
                 $params[$this->paramsNames[$field]] = $value;
306 305
             }
@@ -364,7 +363,7 @@  discard block
 block discarded – undo
364 363
             foreach ($data as $key => $value) {
365 364
                 $uri[] = "$key=$value";
366 365
             }
367
-            $url .= '?'.implode('&', $uri);
366
+            $url .= '?' . implode('&', $uri);
368 367
         }
369 368
         curl_setopt($curl, CURLOPT_URL, $url);
370 369
         if (!$isJson && version_compare(PHP_VERSION, '5.5.0') >= 0 && version_compare(PHP_VERSION, '7.0') < 0 && defined('CURLOPT_SAFE_UPLOAD')) {
@@ -382,7 +381,7 @@  discard block
 block discarded – undo
382 381
             curl_setopt($curl, CURLOPT_HTTPHEADER, [
383 382
                 'Content-Type: application/json; charset=utf-8',
384 383
                 'Accept: application/json',
385
-                'Content-Length: '.strlen($data),
384
+                'Content-Length: ' . strlen($data),
386 385
             ]);
387 386
         }
388 387
         $result = curl_exec($curl);
Please login to merge, or discard this patch.