@@ -13,6 +13,6 @@ |
||
| 13 | 13 | ); |
| 14 | 14 | |
| 15 | 15 | // Recognize using Anticaptcha service |
| 16 | -$captchaText = $client->recognizeFile(__DIR__ . '/data/captcha.png'); |
|
| 16 | +$captchaText = $client->recognizeFile(__DIR__.'/data/captcha.png'); |
|
| 17 | 17 | |
| 18 | 18 | var_dump($captchaText); |
@@ -7,4 +7,4 @@ |
||
| 7 | 7 | new GuzzleHttp\Client() |
| 8 | 8 | ); |
| 9 | 9 | |
| 10 | -var_dump($rucaptcha->recognizeFile(__DIR__ . '/data/captcha.png')); |
|
| 10 | +var_dump($rucaptcha->recognizeFile(__DIR__.'/data/captcha.png')); |
|
@@ -7,7 +7,7 @@ |
||
| 7 | 7 | new GuzzleHttp\Client() |
| 8 | 8 | ); |
| 9 | 9 | |
| 10 | -$pingbackUrl = 'http://' . getenv('__HOST__') .'/captcha/pingback.php'; |
|
| 10 | +$pingbackUrl = 'http://'.getenv('__HOST__').'/captcha/pingback.php'; |
|
| 11 | 11 | |
| 12 | 12 | // Add pingback url to allowed list |
| 13 | 13 | $client->addPingback($pingbackUrl); |
@@ -48,7 +48,7 @@ |
||
| 48 | 48 | |
| 49 | 49 | $serverResponse = $client->getCaptchaResult(''); |
| 50 | 50 | |
| 51 | - if($response==='CAPCHA_NOT_READY') { |
|
| 51 | + if ($response === 'CAPCHA_NOT_READY') { |
|
| 52 | 52 | $this->assertNull($serverResponse); |
| 53 | 53 | } else { |
| 54 | 54 | $this->assertEquals('1234567890', $serverResponse); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | */ |
| 45 | 45 | public function getCaptchaResultBulk(array $captchaIds): array |
| 46 | 46 | { |
| 47 | - $request = new Request('GET', $this->config->getServerBaseUri() . '/res.php?' . http_build_query([ |
|
| 47 | + $request = new Request('GET', $this->config->getServerBaseUri().'/res.php?'.http_build_query([ |
|
| 48 | 48 | 'key' => $this->config->getApiKey(), |
| 49 | 49 | 'action' => 'get', |
| 50 | 50 | 'ids' => implode(',', $captchaIds) |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | */ |
| 77 | 77 | public function getBalance(): string |
| 78 | 78 | { |
| 79 | - $request = new Request('GET', $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=getbalance"); |
|
| 79 | + $request = new Request('GET', $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=getbalance"); |
|
| 80 | 80 | |
| 81 | 81 | $response = $this->httpClient->sendRequest($request); |
| 82 | 82 | |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | { |
| 96 | 96 | $request = new Request( |
| 97 | 97 | 'GET', |
| 98 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=reportbad&id={$captchaId}" |
|
| 98 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=reportbad&id={$captchaId}" |
|
| 99 | 99 | ); |
| 100 | 100 | |
| 101 | 101 | $response = $this->httpClient->sendRequest($request); |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | $request = new Request( |
| 126 | 126 | 'GET', |
| 127 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=reportgood&id={$captchaId}" |
|
| 127 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=reportgood&id={$captchaId}" |
|
| 128 | 128 | ); |
| 129 | 129 | |
| 130 | 130 | $response = $this->httpClient->sendRequest($request); |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | { |
| 152 | 152 | $request = new Request( |
| 153 | 153 | 'GET', |
| 154 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=get2&id={$captchaId}" |
|
| 154 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=get2&id={$captchaId}" |
|
| 155 | 155 | ); |
| 156 | 156 | |
| 157 | 157 | $response = $this->httpClient->sendRequest($request); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | { |
| 189 | 189 | $request = new Request( |
| 190 | 190 | 'GET', |
| 191 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=add_pingback&addr={$url}" |
|
| 191 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=add_pingback&addr={$url}" |
|
| 192 | 192 | ); |
| 193 | 193 | |
| 194 | 194 | $response = $this->httpClient->sendRequest($request); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | { |
| 217 | 217 | $request = new Request( |
| 218 | 218 | 'GET', |
| 219 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=get_pingback" |
|
| 219 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=get_pingback" |
|
| 220 | 220 | ); |
| 221 | 221 | |
| 222 | 222 | $response = $this->httpClient->sendRequest($request); |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | { |
| 247 | 247 | $request = new Request( |
| 248 | 248 | 'GET', |
| 249 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=del_pingback&addr={$uri}" |
|
| 249 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=del_pingback&addr={$uri}" |
|
| 250 | 250 | ); |
| 251 | 251 | |
| 252 | 252 | $response = $this->httpClient->sendRequest($request); |
@@ -308,7 +308,7 @@ discard block |
||
| 308 | 308 | |
| 309 | 309 | $request = new Request( |
| 310 | 310 | 'POST', |
| 311 | - $this->config->getServerBaseUri() . "/in.php?" . http_build_query($params) |
|
| 311 | + $this->config->getServerBaseUri()."/in.php?".http_build_query($params) |
|
| 312 | 312 | ); |
| 313 | 313 | |
| 314 | 314 | $response = $this->httpClient->sendRequest($request); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | continue; |
| 364 | 364 | } |
| 365 | 365 | |
| 366 | - $this->logger->info("Elapsed " . (time()-$startTime) . " second(s)."); |
|
| 366 | + $this->logger->info("Elapsed ".(time() - $startTime)." second(s)."); |
|
| 367 | 367 | |
| 368 | 368 | return $result; |
| 369 | 369 | } |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | |
| 404 | 404 | $request = new Request( |
| 405 | 405 | 'POST', |
| 406 | - $this->config->getServerBaseUri() . "/in.php?". http_build_query(array_merge($extra, [ |
|
| 406 | + $this->config->getServerBaseUri()."/in.php?".http_build_query(array_merge($extra, [ |
|
| 407 | 407 | 'method' => 'userrecaptcha', |
| 408 | 408 | 'version' => 'v3', |
| 409 | 409 | 'key' => $this->config->getApiKey(), |
@@ -466,7 +466,7 @@ discard block |
||
| 466 | 466 | continue; |
| 467 | 467 | } |
| 468 | 468 | |
| 469 | - $this->logger->info("Elapsed " . (time()-$startTime) . " second(s)."); |
|
| 469 | + $this->logger->info("Elapsed ".(time() - $startTime)." second(s)."); |
|
| 470 | 470 | |
| 471 | 471 | return $result; |
| 472 | 472 | } |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | |
| 504 | 504 | $request = new Request( |
| 505 | 505 | 'POST', |
| 506 | - $this->config->getServerBaseUri() . "/in.php?" . http_build_query(array_merge($extra, [ |
|
| 506 | + $this->config->getServerBaseUri()."/in.php?".http_build_query(array_merge($extra, [ |
|
| 507 | 507 | 'method' => 'keycaptcha', |
| 508 | 508 | 'key' => $this->config->getApiKey(), |
| 509 | 509 | 's_s_c_user_id' => $SSCUserId, |
@@ -572,7 +572,7 @@ discard block |
||
| 572 | 572 | continue; |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | - $this->logger->info("Elapsed " . (time()-$startTime) . " second(s)."); |
|
| 575 | + $this->logger->info("Elapsed ".(time() - $startTime)." second(s)."); |
|
| 576 | 576 | |
| 577 | 577 | return $result; |
| 578 | 578 | } |
@@ -591,7 +591,7 @@ discard block |
||
| 591 | 591 | { |
| 592 | 592 | $request = new Request( |
| 593 | 593 | 'GET', |
| 594 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=get&id={$captchaId}&json=1" |
|
| 594 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=get&id={$captchaId}&json=1" |
|
| 595 | 595 | ); |
| 596 | 596 | |
| 597 | 597 | $response = $this->httpClient->sendRequest($request); |
@@ -600,7 +600,7 @@ discard block |
||
| 600 | 600 | |
| 601 | 601 | if (JSON_ERROR_NONE !== json_last_error()) { |
| 602 | 602 | throw new InvalidArgumentException( |
| 603 | - 'json_decode error: ' . json_last_error_msg() |
|
| 603 | + 'json_decode error: '.json_last_error_msg() |
|
| 604 | 604 | ); |
| 605 | 605 | } |
| 606 | 606 | |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | continue; |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | - $this->logger->info("Elapsed " . (time()-$startTime) . " second(s)."); |
|
| 105 | + $this->logger->info("Elapsed ".(time() - $startTime)." second(s)."); |
|
| 106 | 106 | |
| 107 | 107 | return $result; |
| 108 | 108 | } |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | 'body' => base64_encode($content) |
| 129 | 129 | ])); |
| 130 | 130 | |
| 131 | - $request = new Request('POST', $this->config->getServerBaseUri() . '/in.php', $headers, $body); |
|
| 131 | + $request = new Request('POST', $this->config->getServerBaseUri().'/in.php', $headers, $body); |
|
| 132 | 132 | |
| 133 | 133 | $response = $this->httpClient->sendRequest($request); |
| 134 | 134 | |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | { |
| 155 | 155 | $request = new Request( |
| 156 | 156 | 'GET', |
| 157 | - $this->config->getServerBaseUri() . "/res.php?key={$this->config->getApiKey()}&action=get&id={$captchaId}" |
|
| 157 | + $this->config->getServerBaseUri()."/res.php?key={$this->config->getApiKey()}&action=get&id={$captchaId}" |
|
| 158 | 158 | ); |
| 159 | 159 | |
| 160 | 160 | $response = $this->httpClient->sendRequest($request); |