1 | <?php |
||
26 | class TinyCurlEndpoint implements EndpointInterface{ |
||
27 | |||
28 | /** |
||
29 | * @var \chillerlan\Threema\GatewayOptions |
||
30 | */ |
||
31 | protected $gatewayOptions; |
||
32 | |||
33 | /** |
||
34 | * @var \chillerlan\TinyCurl\Request |
||
35 | */ |
||
36 | protected $request; |
||
37 | |||
38 | /** |
||
39 | * TinyCurlEndpoint constructor. |
||
40 | * |
||
41 | * @param \chillerlan\Threema\GatewayOptions $gatewayOptions |
||
42 | * @param \chillerlan\TinyCurl\Request $request |
||
43 | * |
||
44 | * @codeCoverageIgnore |
||
45 | */ |
||
46 | public function __construct(GatewayOptions $gatewayOptions, Request $request){ |
||
52 | |||
53 | /** |
||
54 | * @param string $endpoint |
||
55 | * @param array $params |
||
56 | * @param array $body |
||
57 | * |
||
58 | * @return \chillerlan\TinyCurl\Response\ResponseInterface |
||
59 | * @throws \chillerlan\Threema\GatewayException |
||
60 | * @throws \chillerlan\TinyCurl\RequestException |
||
61 | */ |
||
62 | protected function getResponse(string $endpoint, array $params = [], array $body = []):ResponseInterface{ |
||
86 | |||
87 | /** |
||
88 | * @inheritdoc |
||
89 | */ |
||
90 | public function checkCredits():int{ |
||
93 | |||
94 | /** |
||
95 | * @inheritdoc |
||
96 | */ |
||
97 | public function checkCapabilities(string $threemaID):array{ |
||
105 | |||
106 | /** |
||
107 | * @inheritdoc |
||
108 | */ |
||
109 | public function getIdByPhone(string $phoneno):string{ |
||
112 | |||
113 | /** |
||
114 | * @inheritdoc |
||
115 | */ |
||
116 | public function getIdByPhoneHash(string $phonenoHash):string{ |
||
119 | |||
120 | /** |
||
121 | * @inheritdoc |
||
122 | */ |
||
123 | public function getIdByEmail(string $email):string{ |
||
126 | |||
127 | /** |
||
128 | * @inheritdoc |
||
129 | */ |
||
130 | public function getIdByEmailHash(string $emailHash):string{ |
||
133 | |||
134 | /** |
||
135 | * @inheritdoc |
||
136 | */ |
||
137 | public function getPublicKey(string $threemaID):string{ |
||
140 | |||
141 | /** |
||
142 | * @inheritdoc |
||
143 | */ |
||
144 | public function sendSimple(string $to, string $message):string{ |
||
147 | |||
148 | /** |
||
149 | * @inheritdoc |
||
150 | */ |
||
151 | public function sendE2E(string $threemaID, string $box, string $nonce):string{ |
||
154 | |||
155 | /** |
||
156 | * @inheritdoc |
||
157 | */ |
||
158 | public function upload(string $blob):string{ |
||
161 | |||
162 | /** |
||
163 | * @inheritdoc |
||
164 | */ |
||
165 | public function download(string $blobID){ |
||
168 | |||
169 | /** |
||
170 | * @param string $threemaID |
||
171 | * |
||
172 | * @return string |
||
173 | * @throws \chillerlan\Threema\GatewayException |
||
174 | */ |
||
175 | protected function checkThreemaID(string $threemaID):string{ |
||
183 | |||
184 | /** |
||
185 | * @param string $phoneNo |
||
186 | * |
||
187 | * @return string |
||
188 | * @throws \chillerlan\Threema\GatewayException |
||
189 | */ |
||
190 | protected function checkPhoneNo(string $phoneNo):string{ |
||
199 | |||
200 | /** |
||
201 | * @param $email |
||
202 | * |
||
203 | * @return string |
||
204 | * @throws \chillerlan\Threema\GatewayException |
||
205 | */ |
||
206 | protected function checkEmail($email):string{ |
||
215 | |||
216 | /** |
||
217 | * @param string $hash |
||
218 | * |
||
219 | * @return string |
||
220 | * @throws \chillerlan\Threema\GatewayException |
||
221 | */ |
||
222 | protected function checkHash(string $hash):string{ |
||
230 | |||
231 | } |
||
232 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: