recaptcha
recaptcha copied to clipboard
PHP 8.4 deprecation
- /my_project/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php:139 ReCaptcha\ReCaptcha::__construct(): Implicitly marking parameter $requestMethod as nullable is deprecated, the explicit nullable type must be used instead
The $requestMethod argument should accept null as value.
The following change should be applied
diff --git a/src/ReCaptcha/ReCaptcha.php b/src/ReCaptcha/ReCaptcha.php
index d75ce1f..b928fc8 100644
--- a/src/ReCaptcha/ReCaptcha.php
+++ b/src/ReCaptcha/ReCaptcha.php
@@ -136,7 +136,7 @@ class ReCaptcha
* @param RequestMethod $requestMethod method used to send the request. Defaults to POST.
* @throws \RuntimeException if $secret is invalid
*/
- public function __construct($secret, RequestMethod $requestMethod = null)
+ public function __construct($secret, ?RequestMethod $requestMethod = null)
{
if (empty($secret)) {
throw new \RuntimeException('No secret provided');
I can propose a PR.
Deprecated: ReCaptcha\RequestMethod\CurlPost::__construct(): Implicitly marking parameter $curl as nullable is deprecated, the explicit nullable type must be used instead in /var/www/vhosts/domain.local/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/CurlPost.php on line 66
Being addressed here: https://github.com/google/recaptcha/pull/563
Looks like this project is no longer being supported by google. If you want a PHP 8.4 compatible library, check out:
phpfui/recaptcha
Should be a drop in replacement. Let me know of any issues.
Solved in https://github.com/google/recaptcha/pull/575, this can be close
Happy to see the issue addressed. We still need a release, tho.
Happy to see the issue addressed. We still need a release, tho.
I don't think so, since there is a 1.3.1 tag https://github.com/google/recaptcha/releases/tag/1.3.1