| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 18.18% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class SecurityCaptchaVerifier |
||
| 10 | { |
||
| 11 | private array $googleSettings; |
||
| 12 | |||
| 13 | 42 | public function __construct( |
|
| 17 | } |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Ask google API if reCAPTCHA user response is correct or not. |
||
| 21 | * |
||
| 22 | * @param string $reCaptchaResponse |
||
| 23 | * @param SecurityType $exceptionType Exception type (email, login, global) |
||
| 24 | * |
||
| 25 | * @throws SecurityException |
||
| 26 | * |
||
| 27 | * @return bool true when correct otherwise SecurityException |
||
| 28 | */ |
||
| 29 | public function verifyReCaptcha(string $reCaptchaResponse, SecurityType $exceptionType): bool |
||
| 44 |