From e54200044eb4f6a44948764b91388c2bb0765efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20K=C5=99=C3=AD=C5=BE?= Date: Mon, 28 Nov 2016 12:21:08 +0100 Subject: [PATCH] FailedRequestException: rename requestData -> request --- readme.md | 2 +- src/FailedRequestException.php | 10 +++++----- tests/SlevomatEET/ClientTest.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 5f7349d..7d5e782 100644 --- a/readme.md +++ b/readme.md @@ -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 } diff --git a/src/FailedRequestException.php b/src/FailedRequestException.php index f107954..fa95045 100644 --- a/src/FailedRequestException.php +++ b/src/FailedRequestException.php @@ -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; } } diff --git a/tests/SlevomatEET/ClientTest.php b/tests/SlevomatEET/ClientTest.php index 30450e6..8a044df 100644 --- a/tests/SlevomatEET/ClientTest.php +++ b/tests/SlevomatEET/ClientTest.php @@ -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()); } }