Total Complexity | 2 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | abstract class AbstractBaseEndpoint |
||
9 | { |
||
10 | /** |
||
11 | * Path to be appended after the base URI. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | const ENDPOINT_URI = ''; |
||
16 | |||
17 | /** |
||
18 | * HTTP GET method. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | const GET = 'GET'; |
||
23 | |||
24 | /** |
||
25 | * Keyword to pass the API key on each call. |
||
26 | */ |
||
27 | const ACCESS_PARAM = 'access_token'; |
||
28 | |||
29 | /** |
||
30 | * @var ClientInterface|FixerHttpClient |
||
31 | */ |
||
32 | protected $client; |
||
33 | |||
34 | /** |
||
35 | * AbstractBaseEndpoint constructor. |
||
36 | * @param ClientInterface $client |
||
37 | */ |
||
38 | 9 | public function __construct(ClientInterface $client) |
|
39 | { |
||
40 | 9 | $this->client = $client; |
|
41 | 9 | } |
|
42 | |||
43 | /** |
||
44 | * Query parameters to be appended to the endpoint URI. |
||
45 | * |
||
46 | * @param array $params |
||
47 | * @return string |
||
48 | */ |
||
49 | 9 | public function buildUri(array $params = []): string |
|
56 | } |
||
57 | } |
||
58 |