Total Complexity | 2 |
Total Lines | 46 |
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 | public const ENDPOINT_URI = ''; |
||
16 | |||
17 | /** |
||
18 | * HTTP GET method. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | public const GET = 'GET'; |
||
23 | |||
24 | /** |
||
25 | * Keyword to pass the API key on each call. |
||
26 | */ |
||
27 | public const ACCESS_PARAM = 'access_key'; |
||
28 | |||
29 | /** |
||
30 | * @var FixerHttpClient |
||
31 | */ |
||
32 | protected $client; |
||
33 | |||
34 | /** |
||
35 | * AbstractBaseEndpoint constructor. |
||
36 | * |
||
37 | * @param ClientInterface $client |
||
38 | 24 | */ |
|
39 | public function __construct(FixerHttpClient $client) |
||
40 | 24 | { |
|
41 | 24 | $this->client = $client; |
|
42 | } |
||
43 | |||
44 | /** |
||
45 | * Query parameters to be appended to the endpoint URI. |
||
46 | */ |
||
47 | public function buildUri(array $params = []): string |
||
54 | } |
||
55 | } |
||
56 |