1 | <?php |
||
29 | abstract class AbstractProvider extends BaseProvider { |
||
30 | |||
31 | /** |
||
32 | * Constructor. |
||
33 | * |
||
34 | * @param LoggerInterface|null $logger The logger. |
||
35 | */ |
||
36 | 65 | public function __construct(LoggerInterface $logger = null) { |
|
39 | |||
40 | /** |
||
41 | * Build the configuration. |
||
42 | * |
||
43 | * @return array Returns the configuration. |
||
44 | */ |
||
45 | 50 | private function buildConfiguration(): array { |
|
55 | |||
56 | /** |
||
57 | * Call the API. |
||
58 | * |
||
59 | * @param AbstractRequest $request The request. |
||
60 | * @param array $queryData The query data. |
||
61 | * @param array $postData The post data. |
||
62 | * @return string Returns the raw response. |
||
63 | * @throws GuzzleException Throws a Guzzle exception if an error occurs. |
||
64 | * @throws ApiException Throws an API exception if an error occurs. |
||
65 | */ |
||
66 | 50 | protected function callApi(AbstractRequest $request, array $queryData, array $postData = []): string { |
|
91 | |||
92 | /** |
||
93 | * Get the endpoint path. |
||
94 | * |
||
95 | * @return string Returns the endpoint path. |
||
96 | */ |
||
97 | abstract public function getEndpointPath(): string; |
||
98 | } |