1 | <?php |
||
16 | abstract class AbstractService |
||
17 | { |
||
18 | /** |
||
19 | * @var ConnectionInterface |
||
20 | */ |
||
21 | private $connection; |
||
22 | |||
23 | /** |
||
24 | * AbstractService constructor. |
||
25 | * |
||
26 | * @param ConnectionInterface $connection |
||
27 | */ |
||
28 | public function __construct(ConnectionInterface $connection) |
||
32 | |||
33 | /** |
||
34 | * Calls the API unsigned. |
||
35 | * |
||
36 | * @param string $method |
||
37 | * @param array $params |
||
38 | * @param string $requestMethod |
||
39 | * |
||
40 | * @return array |
||
41 | * |
||
42 | * @throws ApiException |
||
43 | * @throws NotFoundException |
||
44 | */ |
||
45 | final protected function call(string $method, array $params = array(), $requestMethod = 'GET'): array |
||
55 | |||
56 | /** |
||
57 | * Formats a date to a timestamp. |
||
58 | * |
||
59 | * @param \DateTime|null $date |
||
60 | * |
||
61 | * @return string|null |
||
62 | */ |
||
63 | private function toDateString(\DateTime $date = null) : ?string |
||
71 | } |
||
72 |