@@ -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