1 | <?php |
||
24 | final class InstapushClient |
||
25 | { |
||
26 | /** @var \Http\Client\HttpClient */ |
||
27 | private $httpClient; |
||
28 | |||
29 | /** @var \Http\Message\RequestFactory */ |
||
30 | private $requestFactory; |
||
31 | |||
32 | /** @var \Fnayou\InstapushPHP\Transformer\TransformerInterface */ |
||
33 | private $transformer; |
||
34 | |||
35 | /** @var bool */ |
||
36 | private $handleException = true; |
||
37 | |||
38 | /** |
||
39 | * @param \Http\Client\HttpClient $httpClient |
||
40 | * @param \Http\Message\RequestFactory $requestFactory |
||
41 | * @param \Fnayou\InstapushPHP\Transformer\TransformerInterface $transformer |
||
42 | */ |
||
43 | public function __construct( |
||
52 | |||
53 | /** |
||
54 | * @param \Fnayou\InstapushPHP\Http\HttpClientConfiguratorInterface $httpClientConfigurator |
||
55 | * @param \Http\Message\RequestFactory $requestFactory |
||
56 | * @param \Fnayou\InstapushPHP\Transformer\TransformerInterface $transformer |
||
57 | * |
||
58 | * @return $this |
||
59 | */ |
||
60 | public static function configure( |
||
69 | |||
70 | /** |
||
71 | * @param string $userToken |
||
72 | * @param string $appIdentifier |
||
73 | * @param string $appSecret |
||
74 | * |
||
75 | * @return $this |
||
76 | */ |
||
77 | public static function create(string $userToken = null, string $appIdentifier = null, string $appSecret = null) |
||
87 | |||
88 | /** |
||
89 | * @param string $userToken |
||
90 | * |
||
91 | * @return $this |
||
92 | */ |
||
93 | public static function createForUser(string $userToken) |
||
101 | |||
102 | /** |
||
103 | * @param string $appIdentifier |
||
104 | * @param string $appSecret |
||
105 | * |
||
106 | * @return $this |
||
107 | */ |
||
108 | public static function createForApp(string $appIdentifier, string $appSecret) |
||
117 | |||
118 | /** |
||
119 | * @return \Http\Client\HttpClient |
||
120 | */ |
||
121 | public function getHttpClient() |
||
125 | |||
126 | /** |
||
127 | * @param \Http\Client\HttpClient $httpClient |
||
128 | */ |
||
129 | public function setHttpClient(HttpClient $httpClient) |
||
133 | |||
134 | /** |
||
135 | * @return \Http\Message\RequestFactory |
||
136 | */ |
||
137 | public function getRequestFactory() |
||
141 | |||
142 | /** |
||
143 | * @param \Http\Message\RequestFactory $requestFactory |
||
144 | */ |
||
145 | public function setRequestFactory(RequestFactory $requestFactory) |
||
149 | |||
150 | /** |
||
151 | * @return \Fnayou\InstapushPHP\Transformer\TransformerInterface |
||
152 | */ |
||
153 | public function getTransformer() |
||
157 | |||
158 | /** |
||
159 | * @param \Fnayou\InstapushPHP\Transformer\TransformerInterface $transformer |
||
160 | */ |
||
161 | public function setTransformer(TransformerInterface $transformer) |
||
165 | |||
166 | /** |
||
167 | * @return bool |
||
168 | */ |
||
169 | public function isHandleException() |
||
173 | |||
174 | /** |
||
175 | * @param bool $handleException |
||
176 | */ |
||
177 | public function setHandleException(bool $handleException) |
||
181 | |||
182 | /** |
||
183 | * @return Api\ApplicationsApi |
||
184 | */ |
||
185 | public function applications() |
||
189 | |||
190 | /** |
||
191 | * @return Api\EventsApi |
||
192 | */ |
||
193 | public function events() |
||
197 | |||
198 | /** |
||
199 | * @return Api\NotificationApi |
||
200 | */ |
||
201 | public function notification() |
||
205 | } |
||
206 |