Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
FailedRequestException: rename requestData -> request
Browse files Browse the repository at this point in the history
  • Loading branch information
pepakriz authored and janlanger committed Nov 29, 2016
1 parent e7167d3 commit e542000
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ try {
$response = $client->send($receipt);
echo $response->getFik();
} catch (\SlevomatEET\FailedRequestException $e) {
echo $e->getRequestData()->getPkpCode(); // if request fails you need to print the PKP and BKP codes to receipt
echo $e->getRequest()->getPkpCode(); // if request fails you need to print the PKP and BKP codes to receipt
} catch (\SlevomatEET\InvalidResponseReceivedException $e) {
echo $e->getResponse()->getRequest()->getPkpCode(); // on invalid response you need to print the PKP and BKP too
}
Expand Down
10 changes: 5 additions & 5 deletions src/FailedRequestException.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ class FailedRequestException extends \Exception
{

/** @var \SlevomatEET\EvidenceRequest */
private $requestData;
private $request;

public function __construct(EvidenceRequest $requestData, \Throwable $previous)
public function __construct(EvidenceRequest $request, \Throwable $previous)
{
parent::__construct('Request error: ' . $previous->getMessage(), $previous->getCode(), $previous);
$this->requestData = $requestData;
$this->request = $request;
}

public function getRequestData(): EvidenceRequest
public function getRequest(): EvidenceRequest
{
return $this->requestData;
return $this->request;
}

}
2 changes: 1 addition & 1 deletion tests/SlevomatEET/ClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function testSendFailedRequest()
$client->send($receipt);
$this->fail('Expected exception was not thrown');
} catch (FailedRequestException $e) {
$request = $e->getRequestData();
$request = $e->getRequest();
$this->assertSame('', $request->getBkpCode());
}
}
Expand Down

0 comments on commit e542000

Please sign in to comment.