Skip to content

Commit

Permalink
Merge pull request #17 from RyanDaDeng/analysis-q5p3mB
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
RyanDaDeng authored Jan 10, 2019
2 parents ababede + 54c0129 commit 2b7fb44
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/GoogleReCaptchaV3.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ public function setAction($value = null)
return $this;
}


/**
* @param string|null $value
* @return $this
Expand Down
6 changes: 3 additions & 3 deletions src/Services/GoogleReCaptchaV3Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(ReCaptchaConfigV3Interface $config, RequestClientInt
*/
public function verifyResponse($response, $ip = null)
{
if (!$this->config->isServiceEnabled()) {
if (! $this->config->isServiceEnabled()) {
$res = new GoogleReCaptchaV3Response([], $ip);
$res->setSuccess(true);

Expand Down Expand Up @@ -67,7 +67,7 @@ public function verifyResponse($response, $ip = null)
return $rawResponse;
}

if (!empty($this->config->getHostName()) && strcasecmp($this->config->getHostName(), $rawResponse->getHostname()) !== 0) {
if (! empty($this->config->getHostName()) && strcasecmp($this->config->getHostName(), $rawResponse->getHostname()) !== 0) {
$rawResponse->setMessage(GoogleReCaptchaV3Response::ERROR_HOSTNAME);
$rawResponse->setSuccess(false);

Expand All @@ -84,6 +84,7 @@ public function verifyResponse($response, $ip = null)
if (isset($this->score) && $this->score > $rawResponse->getScore()) {
$rawResponse->setSuccess(false);
$rawResponse->setMessage(GoogleReCaptchaV3Response::ERROR_SCORE_THRESHOLD);

return $rawResponse;
} else {
if ($this->getConfig()->isScoreEnabled()) {
Expand All @@ -102,7 +103,6 @@ public function verifyResponse($response, $ip = null)
}
}


$rawResponse->setSuccess(true);
$rawResponse->setMessage('Successfully passed.');

Expand Down
3 changes: 0 additions & 3 deletions tests/ScoreTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ public function testScore6()
$this->assertEquals(true, $response->isSuccess());
}


public function testScore7()
{
// Create a stub for the SomeClass class.
Expand Down Expand Up @@ -252,7 +251,6 @@ public function testScore7()
$this->assertEquals(true, $response->isSuccess());
}


public function testScore11()
{
// Create a stub for the SomeClass class.
Expand Down Expand Up @@ -287,7 +285,6 @@ public function testScore11()
$this->assertEquals(false, $response->isSuccess());
}


public function testScore8()
{
// Create a stub for the SomeClass class.
Expand Down

0 comments on commit 2b7fb44

Please sign in to comment.