1 | <?php |
||
9 | class Client |
||
10 | { |
||
11 | use Traits\ApiMethodsTrait, |
||
12 | Traits\AuthorizationTrait, |
||
13 | Traits\BatchTrait, |
||
14 | Traits\ConfigurationTrait, |
||
15 | Traits\SearchTrait; |
||
16 | |||
17 | /** |
||
18 | * Default client options |
||
19 | * |
||
20 | * @var array |
||
21 | */ |
||
22 | protected static $defaultOptions = [ |
||
23 | 'domain' => 'https://trello.com', |
||
24 | 'key' => null, |
||
25 | 'proxy' => null, |
||
26 | 'version' => '1', |
||
27 | 'secret' => null, |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * Authorization broker |
||
32 | * |
||
33 | * @var Authorization |
||
34 | */ |
||
35 | protected $authorization; |
||
36 | |||
37 | /** |
||
38 | * Http broker |
||
39 | * |
||
40 | * @var Http |
||
41 | */ |
||
42 | protected $http; |
||
43 | |||
44 | /** |
||
45 | * Creates new trello client. |
||
46 | * |
||
47 | * @param array $options |
||
48 | */ |
||
49 | public function __construct($options = []) |
||
55 | |||
56 | /** |
||
57 | * Retrieves the authorization broker. |
||
58 | * |
||
59 | * @return Stevenmaguire\Services\Trello\Authorization |
||
60 | */ |
||
61 | public function getAuthorization() |
||
69 | |||
70 | /** |
||
71 | * Retrieves currently configured http broker. |
||
72 | * |
||
73 | * @return Stevenmaguire\Services\Trello\Http |
||
74 | */ |
||
75 | public function getHttp() |
||
79 | |||
80 | /** |
||
81 | * Updates the authorization broker. |
||
82 | * |
||
83 | * @param Authorization $authorization |
||
84 | * |
||
85 | * @return Client |
||
86 | */ |
||
87 | public function setAuthorization(Authorization $authorization) |
||
93 | |||
94 | /** |
||
95 | * Updates the http client used by http broker. |
||
96 | * |
||
97 | * @param ClientInterface $httpClient |
||
98 | * |
||
99 | * @return Client |
||
100 | */ |
||
101 | public function setHttpClient(ClientInterface $httpClient) |
||
107 | |||
108 | /** |
||
109 | * Updates the http request factory used by http broker. |
||
110 | * |
||
111 | * @param RequestFactoryInterface $httpRequestFactory |
||
112 | * |
||
113 | * @return Client |
||
114 | */ |
||
115 | public function setHttpRequestFactory(RequestFactoryInterface $httpRequestFactory) |
||
121 | |||
122 | /** |
||
123 | * Updates the http stream factory used by http broker. |
||
124 | * |
||
125 | * @param StreamFactoryInterface $httpStreamFactory |
||
126 | * |
||
127 | * @return Client |
||
128 | */ |
||
129 | public function setHttpStreamFactory(StreamFactoryInterface $httpStreamFactory) |
||
135 | } |
||
136 |