1 | <?php |
||
12 | class HttpClient implements HttpClientInterface |
||
13 | { |
||
14 | const GET_ALL_CARDS_URL = 'https://api.trello.com/1/boards/{boardId}/cards/?key={apiKey}&token={token}'; |
||
15 | |||
16 | const GET_CREATION_CARD_INFO_URL = 'https://api.trello.com/1/cards/{cardId}/actions?filter=createCard&key={apiKey}&token={token}'; |
||
17 | |||
18 | const GET_HISTORY_CARD_URL = 'https://api.trello.com/1/cards/{cardId}/actions?filter=updateCard:idList&key={apiKey}&token={token}'; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $apiKey; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $token; |
||
28 | /** |
||
29 | * @var string |
||
30 | */ |
||
31 | private $boardId; |
||
32 | |||
33 | 3 | public function __construct(string $apiKey, string $token, string $boardId) |
|
39 | |||
40 | 1 | public function findAllCards(): array |
|
46 | |||
47 | 1 | public function findCreationCard(string $cardId): array |
|
53 | |||
54 | 1 | public function findAllCardHistory(string $cardId): array |
|
60 | |||
61 | public function createRequest(string $url) |
||
72 | |||
73 | 3 | protected function urlBuilder($url, $cardId = null) |
|
80 | } |