diff --git a/src/PlaidException.php b/src/PlaidException.php index 46e3de1..8763469 100644 --- a/src/PlaidException.php +++ b/src/PlaidException.php @@ -4,7 +4,6 @@ use Exception; - class PlaidException extends Exception { } \ No newline at end of file diff --git a/src/PlaidRequestException.php b/src/PlaidRequestException.php index a39661a..bdbcffc 100644 --- a/src/PlaidRequestException.php +++ b/src/PlaidRequestException.php @@ -5,43 +5,42 @@ use Exception; use Psr\Http\Message\ResponseInterface; - class PlaidRequestException extends Exception { - /** - * Get the response payload. - * - * @var object|null - */ - protected $response; - - /** - * PlaidRequestException constructor. - * - * @param ResponseInterface $responseInterface - */ - public function __construct(ResponseInterface $responseInterface) - { - $this->response = \json_decode($responseInterface->getBody()->getContents()); - - $this->code = $responseInterface->getStatusCode(); - - if( \is_object($this->response) ){ - $this->message = $this->response->display_message ?? $responseInterface->getReasonPhrase(); - } - - else { - $this->message = $responseInterface->getReasonPhrase(); - } - } - - /** - * Get the Plaid specific error payload. - * - * @return object|null - */ - public function getResponse(): ?object - { - return $this->response; - } + /** + * Get the response payload. + * + * @var object|null + */ + protected $response; + + /** + * PlaidRequestException constructor. + * + * @param ResponseInterface $responseInterface + */ + public function __construct(ResponseInterface $responseInterface) + { + $this->response = \json_decode($responseInterface->getBody()->getContents()); + + $this->code = $responseInterface->getStatusCode(); + + if( \is_object($this->response) ){ + $this->message = $this->response->display_message ?? $responseInterface->getReasonPhrase(); + } + + else { + $this->message = $responseInterface->getReasonPhrase(); + } + } + + /** + * Get the Plaid specific error payload. + * + * @return object|null + */ + public function getResponse(): ?object + { + return $this->response; + } } \ No newline at end of file