1 | <?php |
||
33 | class Notifications { |
||
34 | const RESPONSE_FORMAT = 'json'; // default response format for ocs calls |
||
35 | |||
36 | /** @var AddressHandler */ |
||
37 | private $addressHandler; |
||
38 | |||
39 | /** @var IClientService */ |
||
40 | private $httpClientService; |
||
41 | |||
42 | /** @var DiscoveryManager */ |
||
43 | private $discoveryManager; |
||
44 | |||
45 | 1 | /** @var IJobList */ |
|
46 | private $jobList; |
||
47 | |||
48 | /** @var IConfig */ |
||
49 | 1 | private $config; |
|
50 | 1 | ||
51 | 1 | /** |
|
52 | * @param AddressHandler $addressHandler |
||
53 | * @param IClientService $httpClientService |
||
54 | * @param DiscoveryManager $discoveryManager |
||
55 | * @param IJobList $jobList |
||
56 | * @param IConfig $config |
||
57 | */ |
||
58 | public function __construct( |
||
71 | |||
72 | /** |
||
73 | * send server-to-server share to remote server |
||
74 | * |
||
75 | * @param Address $shareWithAddress |
||
76 | * @param Address $ownerAddress |
||
77 | * @param Address $sharedByAddress |
||
78 | * @param string $token |
||
79 | * @param string $shareWith |
||
|
|||
80 | * @param string $name |
||
81 | * @param int $remote_id |
||
82 | * |
||
83 | * @return bool |
||
84 | * |
||
85 | * @throws \OC\HintException |
||
86 | * @throws \OC\ServerNotAvailableException |
||
87 | */ |
||
88 | public function sendRemoteShare(Address $shareWithAddress, |
||
115 | |||
116 | /** |
||
117 | * ask owner to re-share the file with the given user |
||
118 | * |
||
119 | * @param string $token |
||
120 | * @param int $id remote Id |
||
121 | * @param int $shareId internal share Id |
||
122 | * @param string $remote remote address of the owner |
||
123 | * @param string $shareWith |
||
124 | * @param int $permission |
||
125 | * @return bool |
||
126 | * @throws \Exception |
||
127 | */ |
||
128 | public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission) { |
||
153 | |||
154 | /** |
||
155 | * send server-to-server unshare to remote server |
||
156 | * |
||
157 | * @param string $remote url |
||
158 | * @param int $id share id |
||
159 | * @param string $token |
||
160 | * @return bool |
||
161 | */ |
||
162 | public function sendRemoteUnShare($remote, $id, $token) { |
||
165 | |||
166 | /** |
||
167 | * send server-to-server unshare to remote server |
||
168 | * |
||
169 | * @param string $remote url |
||
170 | * @param int $id share id |
||
171 | * @param string $token |
||
172 | * @return bool |
||
173 | */ |
||
174 | public function sendRevokeShare($remote, $id, $token) { |
||
177 | |||
178 | /** |
||
179 | * send notification to remote server if the permissions was changed |
||
180 | * |
||
181 | * @param string $remote |
||
182 | * @param int $remoteId |
||
183 | * @param string $token |
||
184 | * @param int $permissions |
||
185 | * @return bool |
||
186 | */ |
||
187 | public function sendPermissionChange($remote, $remoteId, $token, $permissions) { |
||
190 | |||
191 | /** |
||
192 | * forward accept reShare to remote server |
||
193 | * |
||
194 | * @param string $remote |
||
195 | * @param int $remoteId |
||
196 | * @param string $token |
||
197 | */ |
||
198 | public function sendAcceptShare($remote, $remoteId, $token) { |
||
201 | |||
202 | /** |
||
203 | * forward decline reShare to remote server |
||
204 | * |
||
205 | * @param string $remote |
||
206 | * @param int $remoteId |
||
207 | * @param string $token |
||
208 | */ |
||
209 | public function sendDeclineShare($remote, $remoteId, $token) { |
||
212 | |||
213 | /** |
||
214 | * inform remote server whether server-to-server share was accepted/declined |
||
215 | * |
||
216 | * @param string $remote |
||
217 | * @param int $remoteId Share id on the remote host |
||
218 | * @param string $token |
||
219 | * @param string $action possible actions: |
||
220 | * accept, decline, unshare, revoke, permissions |
||
221 | * @param array $data |
||
222 | * @param int $try |
||
223 | * |
||
224 | * @return boolean |
||
225 | * |
||
226 | * @throws \Exception |
||
227 | */ |
||
228 | public function sendUpdateToRemote($remote, $remoteId, $token, $action, $data = [], $try = 0) { |
||
257 | |||
258 | /** |
||
259 | * return current timestamp |
||
260 | * |
||
261 | * @return int |
||
262 | */ |
||
263 | protected function getTimestamp() { |
||
266 | |||
267 | /** |
||
268 | * try http post first with https and then with http as a fallback |
||
269 | * |
||
270 | * @param string $remoteDomain |
||
271 | * @param string $urlSuffix |
||
272 | * @param array $fields post parameters |
||
273 | * @return array |
||
274 | * @throws \Exception |
||
275 | */ |
||
276 | protected function tryHttpPostToShareEndpoint($remoteDomain, $urlSuffix, array $fields, $useOcm = false) { |
||
321 | |||
322 | protected function sendOcmRemoteShare(Address $shareWithAddress, Address $ownerAddress, Address $sharedByAddress, $token, $name, $remote_id) { |
||
349 | |||
350 | protected function sendPreOcmRemoteShare(Address $shareWithAddress, Address $ownerAddress, Address $sharedByAddress, $token, $name, $remote_id) { |
||
371 | |||
372 | /** |
||
373 | * Validate ocs response - 100 or 200 means success |
||
374 | * |
||
375 | * @param array $status |
||
376 | * |
||
377 | * @return bool |
||
378 | */ |
||
379 | private function isOcsStatusOk($status) { |
||
382 | } |
||
383 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function. It has, however, found a similar but not annotated parameter which might be a good fit.
Consider the following example. The parameter
$ireland
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was changed, but the annotation was not.