|
8 | 8 |
|
9 | 9 | class Recaptcha
|
10 | 10 | {
|
11 |
| - /** |
12 |
| - * The http request instance. |
13 |
| - */ |
14 |
| - private Request $request; |
15 |
| - |
16 |
| - /** |
17 |
| - * The recaptcha site key. |
18 |
| - */ |
19 |
| - private string $siteKey; |
20 |
| - |
21 |
| - /** |
22 |
| - * The recaptcha secret key. |
23 |
| - */ |
24 |
| - private string $secretKey; |
25 |
| - |
26 |
| - /** |
27 |
| - * The minimum score a recaptcha response must have to be valid. |
28 |
| - */ |
29 |
| - private float $minimumScore; |
30 |
| - |
31 |
| - public function __construct(Request $request, string $siteKey, string $secretKey, float $minimumScore) |
32 |
| - { |
33 |
| - $this->request = $request; |
34 |
| - $this->siteKey = $siteKey; |
35 |
| - $this->secretKey = $secretKey; |
36 |
| - $this->minimumScore = $minimumScore; |
| 11 | + public function __construct( |
| 12 | + private Request $request, |
| 13 | + private string $siteKey, |
| 14 | + private string $secretKey, |
| 15 | + private float $minimumScore |
| 16 | + ) { |
37 | 17 | }
|
38 | 18 |
|
39 |
| - /** |
40 |
| - * Resolve the captcha score. |
41 |
| - * |
42 |
| - * @throws \GuzzleHttp\Exception\GuzzleException |
43 |
| - */ |
| 19 | + /** @throws \GuzzleHttp\Exception\GuzzleException */ |
44 | 20 | public function isValid(): bool
|
45 | 21 | {
|
46 | 22 | if (! $this->request->has('recaptcha_response')) {
|
@@ -68,9 +44,6 @@ public function isValid(): bool
|
68 | 44 | }
|
69 | 45 | }
|
70 | 46 |
|
71 |
| - /** |
72 |
| - * Get the required recaptcha js scripts. |
73 |
| - */ |
74 | 47 | public function script(?string $action = null, string $elementId = 'recaptchaResponse'): string
|
75 | 48 | {
|
76 | 49 | return <<<EOD
|
|
0 commit comments