for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Gameap\Validators;
use GuzzleHttp\Client;
class ReCaptcha
{
public function validate($attribute, $value, $parameters, $validator)
$attribute
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public function validate(/** @scrutinizer ignore-unused */ $attribute, $value, $parameters, $validator)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
$parameters
public function validate($attribute, $value, /** @scrutinizer ignore-unused */ $parameters, $validator)
$validator
public function validate($attribute, $value, $parameters, /** @scrutinizer ignore-unused */ $validator)
$client = new Client();
$response = $client->post(
'https://www.google.com/recaptcha/api/siteverify',
['form_params' =>
[
'secret' => env('GOOGLE_RECAPTCHA_SECRET'),
'response' => $value,
],
]
);
$body = json_decode((string)$response->getBody());
return $body->success;
}
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.