In method refresh_token() it is being assumed that an array is being returned, which is not the case:
array_key_exists("access_token", $result)
Therefore it should rather be:
property_exists($result, "access_token")
Previously type-checking the $result could prevent passing the wrong data-type:
if (
$result == null ||
is_array($result) && !array_key_exists("access_token", $result) ||
is_object($result) && !property_exists($result, "access_token")
) {
return null;
}
In method
refresh_token()it is being assumed that anarrayis being returned, which is not the case:Therefore it should rather be:
Previously type-checking the
$resultcould prevent passing the wrong data-type: