| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 9 | public function validate($attribute, $value, $parameters, $validator) |
||
| 10 | { |
||
| 11 | $client = new Client(); |
||
| 12 | |||
| 13 | $response = $client->post( |
||
| 14 | 'https://www.google.com/recaptcha/api/siteverify', |
||
| 15 | ['form_params' => |
||
| 16 | [ |
||
| 17 | 'secret' => env('GOOGLE_RECAPTCHA_SECRET'), |
||
| 18 | 'response' => $value, |
||
| 19 | ], |
||
| 20 | ] |
||
| 21 | ); |
||
| 22 | |||
| 23 | $body = json_decode((string)$response->getBody()); |
||
| 24 | return $body->success; |
||
| 25 | } |
||
| 27 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.