Skip to content

Commit

Permalink
Cleaning up whitespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
brentscheffler committed Jun 16, 2020
1 parent f8cb0ab commit b553c9f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 38 deletions.
1 change: 0 additions & 1 deletion src/PlaidException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Exception;


class PlaidException extends Exception
{
}
73 changes: 36 additions & 37 deletions src/PlaidRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

0 comments on commit b553c9f

Please sign in to comment.