Skip to content

Commit

Permalink
Fix json_encode deprecation warning
Browse files Browse the repository at this point in the history
Since `developerPayload` is not mandatory `json_encode()` will throw a deprecation warning in PHP8  when `developerPayload` is null.
  • Loading branch information
sica07 authored Nov 10, 2022
1 parent 820aaf1 commit 4134ca0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/GooglePlay/PurchaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ class PurchaseResponse extends AbstractResponse
public function __construct($response)
{
parent::__construct($response);
$this->developerPayload = json_decode($this->response->developerPayload, true);
if (isset($this->response->developerPayload)) {
$this->developerPayload = json_decode($this->response->developerPayload, true);
}
}

/**
Expand Down

0 comments on commit 4134ca0

Please sign in to comment.