@@ -95,11 +95,11 @@ public static function fromJson($json)
95
95
return new Response (false , array (ReCaptcha::E_INVALID_JSON ));
96
96
}
97
97
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 ' ] : '' ;
101
101
$ score = isset ($ responseData ['score ' ]) ? floatval ($ responseData ['score ' ]) : null ;
102
- $ action = isset ($ responseData ['action ' ]) ? $ responseData ['action ' ] : null ;
102
+ $ action = isset ($ responseData ['action ' ]) ? $ responseData ['action ' ] : '' ;
103
103
104
104
if (isset ($ responseData ['success ' ]) && $ responseData ['success ' ] == true ) {
105
105
return new Response (true , array (), $ hostname , $ challengeTs , $ apkPackageName , $ score , $ action );
@@ -123,7 +123,7 @@ public static function fromJson($json)
123
123
* @param string $action
124
124
* @param array $errorCodes
125
125
*/
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 = '' )
127
127
{
128
128
$ this ->success = $ success ;
129
129
$ this ->hostname = $ hostname ;
0 commit comments