Skip to content

Commit

Permalink
Return null when ask for specific parameter in response
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuCh3n committed Dec 16, 2024
1 parent 3a20862 commit f5a3131
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Transaction/Response/TransactionResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,14 @@ public function isValidationFailure(): bool
*/
public function data(?string $key = null)
{
if ($key && isset($this->data[$key]))
if ($key)
{
return $this->data[$key];
if (isset($this->data[$key]))
{
return $this->data[$key];
}

return null;
}

return $this->data;
Expand Down

0 comments on commit f5a3131

Please sign in to comment.