Skip to content

Commit 8daa6fd

Browse files
author
gauthier witkowski
committed
Fix php 8.2 depreciations
1 parent bf2f5a6 commit 8daa6fd

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

vendor/recaptcha/ReCaptcha/ReCaptcha.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
/**
3838
* reCAPTCHA client.
3939
*/
40-
#[\AllowDynamicProperties]
4140
class ReCaptcha
4241
{
4342
/**
@@ -124,6 +123,12 @@ class ReCaptcha
124123
*/
125124
private $requestMethod;
126125

126+
private $hostname;
127+
private $apkPackageName;
128+
private $action;
129+
private $threshold;
130+
private $timeoutSeconds;
131+
127132
/**
128133
* Create a configured instance to use the reCAPTCHA service.
129134
*

vendor/recaptcha/ReCaptcha/RequestMethod/SocketPost.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class SocketPost implements RequestMethod
5151
*/
5252
private $socket;
5353

54+
private $siteVerifyUrl;
55+
5456
/**
5557
* Only needed if you want to override the defaults
5658
*

vendor/recaptcha/ReCaptcha/Response.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,11 +95,11 @@ public static function fromJson($json)
9595
return new Response(false, array(ReCaptcha::E_INVALID_JSON));
9696
}
9797

98-
$hostname = isset($responseData['hostname']) ? $responseData['hostname'] : null;
99-
$challengeTs = isset($responseData['challenge_ts']) ? $responseData['challenge_ts'] : null;
100-
$apkPackageName = isset($responseData['apk_package_name']) ? $responseData['apk_package_name'] : null;
98+
$hostname = isset($responseData['hostname']) ? $responseData['hostname'] : '';
99+
$challengeTs = isset($responseData['challenge_ts']) ? $responseData['challenge_ts'] : '';
100+
$apkPackageName = isset($responseData['apk_package_name']) ? $responseData['apk_package_name'] : '';
101101
$score = isset($responseData['score']) ? floatval($responseData['score']) : null;
102-
$action = isset($responseData['action']) ? $responseData['action'] : null;
102+
$action = isset($responseData['action']) ? $responseData['action'] : '';
103103

104104
if (isset($responseData['success']) && $responseData['success'] == true) {
105105
return new Response(true, array(), $hostname, $challengeTs, $apkPackageName, $score, $action);
@@ -123,7 +123,7 @@ public static function fromJson($json)
123123
* @param string $action
124124
* @param array $errorCodes
125125
*/
126-
public function __construct($success, array $errorCodes = array(), $hostname = null, $challengeTs = null, $apkPackageName = null, $score = null, $action = null)
126+
public function __construct($success, array $errorCodes = array(), $hostname = '', $challengeTs = '', $apkPackageName = '', $score = null, $action = '')
127127
{
128128
$this->success = $success;
129129
$this->hostname = $hostname;

0 commit comments

Comments
 (0)