1 | <?php |
||
12 | class TrelloApiClient 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 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $boardId; |
||
33 | |||
34 | 4 | public function __construct(string $apiKey, string $token) |
|
39 | |||
40 | 1 | public function setBoardId(string $boardId) |
|
44 | |||
45 | 1 | public function getBoardId() :?string |
|
49 | |||
50 | 1 | public function findAllCards(): array |
|
56 | |||
57 | 1 | public function findCreationCard(string $cardId): array |
|
63 | |||
64 | 1 | public function findAllCardHistory(string $cardId): array |
|
70 | |||
71 | public function createRequest(string $url) |
||
82 | |||
83 | 3 | protected function urlBuilder($url, $cardId = null) |
|
90 | } |