Lint PHP code psr-12, add GH action

This commit is contained in:
Julien Nahum
2024-02-23 11:54:12 +01:00
parent e85e4df7fe
commit 62971a2ef4
226 changed files with 2338 additions and 2144 deletions

View File

@@ -7,7 +7,7 @@ use Illuminate\Support\Facades\Http;
class ValidHCaptcha implements ImplicitRule
{
const H_CAPTCHA_VERIFY_URL = "https://hcaptcha.com/siteverify";
public const H_CAPTCHA_VERIFY_URL = 'https://hcaptcha.com/siteverify';
private $error = 'Invalid CAPTCHA. Please prove you\'re not a bot.';
@@ -21,13 +21,14 @@ class ValidHCaptcha implements ImplicitRule
public function passes($attribute, $value)
{
if (empty($value)) {
$this->error = "Please complete the captcha.";
$this->error = 'Please complete the captcha.';
return false;
}
return Http::asForm()->post(self::H_CAPTCHA_VERIFY_URL, [
'secret' => config('services.h_captcha.secret_key'),
'response' => $value
'response' => $value,
])->json('success');
}