Skip to content

Commit

Permalink
refactor: following rector changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ddevsr committed Nov 28, 2022
1 parent 9a92154 commit 48accc2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Recaptcha.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __construct(RecaptchaConfig $config)
*/
protected function _submitHTTPGet(array $data = [])
{
$url = count($data) > 0 ? self::site_verify_url . '?' . http_build_query($data) : self::site_verify_url;
$url = $data !== [] ? self::site_verify_url . '?' . http_build_query($data) : self::site_verify_url;

if (ini_get('allow_url_fopen')) {
return file_get_contents($url);
Expand Down Expand Up @@ -94,12 +94,12 @@ public function verifyResponse($response, $remoteIp = null)
$status = true;
} else {
$status = false;
$error = (isset($responses['error-codes'])) ? $responses['error-codes'] : 'invalid-input-response';
$error = $responses['error-codes'] ?? 'invalid-input-response';
}

return [
'success' => $status,
'error-codes' => (isset($error)) ? $error : null,
'error-codes' => $error ?? null,
];
}

Expand All @@ -120,7 +120,7 @@ public function getScriptTag(array $parameters = [])
'hl' => $this->config->recaptchaLang,
];

$result = count($parameters) > 0 ? array_merge($default, $parameters) : $default;
$result = $parameters !== [] ? array_merge($default, $parameters) : $default;

return sprintf(
'<script type="text/javascript" src="%s?%s" defer></script>',
Expand All @@ -146,7 +146,7 @@ public function getWidget(array $parameters = [])
'data-size' => 'normal',
];

$result = count($parameters) > 0 ? array_merge($default, $parameters) : $default;
$result = $parameters !== [] ? array_merge($default, $parameters) : $default;
$countedResult = count($result);

$html = '';
Expand Down

0 comments on commit 48accc2

Please sign in to comment.