Skip to content

Commit 6e3c7d7

Browse files
committed
Fix typo, included getParameter method in WebResponse interface.
1 parent b1b73aa commit 6e3c7d7

3 files changed

Lines changed: 17 additions & 6 deletions

File tree

src/Trafiklab/Common/Model/Contract/PublicTransportApiWrapper.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
use Trafiklab\Common\Model\Exceptions\InvalidKeyException;
77
use Trafiklab\Common\Model\Exceptions\InvalidRequestException;
8-
use Trafiklab\Common\Model\Exceptions\InvalidStoplocationException;
8+
use Trafiklab\Common\Model\Exceptions\InvalidStopLocationException;
99
use Trafiklab\Common\Model\Exceptions\KeyRequiredException;
1010
use Trafiklab\Common\Model\Exceptions\QuotaExceededException;
1111
use Trafiklab\Common\Model\Exceptions\RequestTimedOutException;
@@ -60,7 +60,7 @@ public function setFindStopLocationApiKey(string $apiKey): void;
6060
* @return TimeTableResponse The response from the API.
6161
* @throws InvalidKeyException
6262
* @throws InvalidRequestException
63-
* @throws InvalidStoplocationException
63+
* @throws InvalidStopLocationException
6464
* @throws KeyRequiredException
6565
* @throws QuotaExceededException
6666
* @throws RequestTimedOutException
@@ -76,7 +76,7 @@ public function getTimeTable(TimeTableRequest $timeTableRequest): TimeTableRespo
7676
* @return RoutePlanningResponse The response from the API.
7777
* @throws InvalidKeyException
7878
* @throws InvalidRequestException
79-
* @throws InvalidStoplocationException
79+
* @throws InvalidStopLocationException
8080
* @throws KeyRequiredException
8181
* @throws QuotaExceededException
8282
* @throws RequestTimedOutException
@@ -93,7 +93,7 @@ public function getRoutePlanning(RoutePlanningRequest $routePlanningRequest): Ro
9393
* @return FindStopLocationResponse The response from the API.
9494
* @throws InvalidKeyException
9595
* @throws InvalidRequestException
96-
* @throws InvalidStoplocationException
96+
* @throws InvalidStopLocationException
9797
* @throws KeyRequiredException
9898
* @throws QuotaExceededException
9999
* @throws RequestTimedOutException

src/Trafiklab/Common/Model/Contract/WebResponse.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Trafiklab\Common\Model\Contract;
44

5+
use Trafiklab\Common\Internal\WebResponseImpl;
6+
57
/**
68
* A response from a webserver.
79
*
@@ -45,4 +47,13 @@ public function getRequestUrl(): string;
4547
* @return bool Whether or not this response is served from cache.
4648
*/
4749
public function isFromLocalCache(): bool;
50+
51+
/**
52+
* Retrieve one of the request parameters which were used to make this request.
53+
*
54+
* @param string $name The parameter to retrieve.
55+
*
56+
* @return mixed One of the request parameters which were used to make this request.
57+
*/
58+
public function getRequestParameter(string $name);
4859
}

src/Trafiklab/Common/Model/Exceptions/InvalidStoplocationException.php renamed to src/Trafiklab/Common/Model/Exceptions/InvalidStopLocationException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
use Throwable;
66

77
/**
8-
* Class InvalidStoplocationException
8+
* Class InvalidStopLocationException
99
*
1010
* Thrown when a request to an API contains an invalid stop location ID.
1111
*
1212
* @package Trafiklab\Common\Model\Exceptions
1313
*/
14-
class InvalidStoplocationException extends InvalidRequestException
14+
class InvalidStopLocationException extends InvalidRequestException
1515
{
1616
public function __construct(array $parameters = [], Throwable $previous = null)
1717
{

0 commit comments

Comments
 (0)