From 908a9dbe6eaaea200fb27fe72357e00a92ede725 Mon Sep 17 00:00:00 2001 From: Reedy Date: Fri, 19 Jul 2024 19:14:14 +0100 Subject: [PATCH] Trim trailing whitespace --- examples/amazon_waf_options.php | 2 +- examples/turnstile_options.php | 2 +- examples/yandex_options.php | 2 +- src/TwoCaptcha.php | 22 +++++++++++----------- tests/AmazonWafTest.php | 2 +- tests/FunCaptchaTest.php | 2 +- tests/GeeTestV4.php | 2 +- tests/autoloader.php | 2 +- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/examples/amazon_waf_options.php b/examples/amazon_waf_options.php index 4651a25..2e8b537 100644 --- a/examples/amazon_waf_options.php +++ b/examples/amazon_waf_options.php @@ -18,7 +18,7 @@ 'proxy' => [ 'type' => 'HTTPS', 'uri' => 'login:password@IP_address:PORT', - ], + ], ]); } catch (\Exception $e) { die($e->getMessage()); diff --git a/examples/turnstile_options.php b/examples/turnstile_options.php index 903aa0f..8fc2d82 100644 --- a/examples/turnstile_options.php +++ b/examples/turnstile_options.php @@ -18,7 +18,7 @@ 'proxy' => [ 'type' => 'HTTPS', 'uri' => 'login:password@IP_address:PORT', - ], + ], ]); } catch (\Exception $e) { die($e->getMessage()); diff --git a/examples/yandex_options.php b/examples/yandex_options.php index 5cc4a26..a6324be 100644 --- a/examples/yandex_options.php +++ b/examples/yandex_options.php @@ -16,7 +16,7 @@ 'proxy' => [ 'type' => 'HTTPS', 'uri' => 'login:password@IP_address:PORT', - ], + ], ]); } catch (\Exception $e) { die($e->getMessage()); diff --git a/src/TwoCaptcha.php b/src/TwoCaptcha.php index 07dc9d4..305e6bf 100644 --- a/src/TwoCaptcha.php +++ b/src/TwoCaptcha.php @@ -189,7 +189,7 @@ public function yandex($captcha) return $this->solve($captcha, ['timeout' => $this->recaptchaTimeout]); } - + /** * Wrapper for solving Turnstile * @@ -274,7 +274,7 @@ public function geetest_v4($captcha) return $this->solve($captcha); } - + /** * Wrapper for solving hCaptcha @@ -308,7 +308,7 @@ public function lemin($captcha) $captcha['method'] = 'lemin'; return $this->solve($captcha); - } + } /** * Wrapper for solving KeyCaptcha @@ -395,8 +395,8 @@ public function canvas($captcha) if ( empty($captcha['hintText']) && empty($captcha['hintImg']) ) { throw new ValidationException('At least one of parameters: hintText or hintImg required!'); - } - + } + return $this->solve($captcha); } @@ -434,21 +434,21 @@ public function coordinates($captcha) * @throws ApiException * @throws NetworkException * @throws TimeoutException - * @throws ValidationException + * @throws ValidationException */ public function audio($captcha){ if (is_string($captcha)) { if (!file_exists($captcha)) { throw new ValidationException('File not found (' . $captcha . ')'); - } + } $body = file_get_contents($captcha); $body = base64_encode($body); $captcha = [ 'body' => $body, ]; - } - + } + $captcha['method'] = 'audio'; return $this->solve($captcha); } @@ -468,9 +468,9 @@ public function rotate($captcha) if (is_string($captcha)) { if (!file_exists($captcha)) { throw new ValidationException('File not found (' . $captcha . ')'); - } + } $body = file_get_contents($captcha); - $body = base64_encode($body); + $body = base64_encode($body); $captcha = [ 'body' => $body, ]; diff --git a/tests/AmazonWafTest.php b/tests/AmazonWafTest.php index 5775aec..7f00011 100644 --- a/tests/AmazonWafTest.php +++ b/tests/AmazonWafTest.php @@ -12,7 +12,7 @@ public function testAllOptions() 'sitekey' => 'AQIDAHjcYu/GjX+QlghicBgQ/7bFaQZ+m5FKCMDnO+vTbNg96AF5H1K/siwSLK7RfstKtN5bAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglg', 'pageurl' => 'https://non-existent-example.execute-api.us-east-1.amazonaws.com', 'iv' => 'test_iv', - 'context' => 'test_context', + 'context' => 'test_context', 'proxy' => [ 'type' => 'HTTPS', 'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321', diff --git a/tests/FunCaptchaTest.php b/tests/FunCaptchaTest.php index 281ca77..a78da4f 100644 --- a/tests/FunCaptchaTest.php +++ b/tests/FunCaptchaTest.php @@ -19,7 +19,7 @@ public function testAllOptions() 'proxy' => [ 'type' => 'HTTPS', 'uri' => 'username:str0ngP@$$W0rd@1.2.3.4:4321', - ] + ] ]; $sendParams = [ diff --git a/tests/GeeTestV4.php b/tests/GeeTestV4.php index d35b436..960b2bc 100644 --- a/tests/GeeTestV4.php +++ b/tests/GeeTestV4.php @@ -28,7 +28,7 @@ public function testAllOptions() 'soft_id' => '4585', ]; - + $this->checkIfCorrectParamsSendAndResultReturned([ 'params' => $params, diff --git a/tests/autoloader.php b/tests/autoloader.php index 05a80c5..9dd31b5 100644 --- a/tests/autoloader.php +++ b/tests/autoloader.php @@ -9,6 +9,6 @@ $relativeClass = substr($class, $len); $file = __DIR__ . '/../src/' . str_replace('\\', '/', $relativeClass) . '.php'; - + if (file_exists($file)) require $file; }); \ No newline at end of file