@@ -134,7 +134,7 @@ public function createShare() {
134
134
$ owner = isset ($ _POST ['owner ' ]) ? $ _POST ['owner ' ] : null ;
135
135
$ sharedBy = isset ($ _POST ['sharedBy ' ]) ? $ _POST ['sharedBy ' ] : null ;
136
136
$ shareWith = isset ($ _POST ['shareWith ' ]) ? $ _POST ['shareWith ' ] : null ;
137
- $ remoteId = isset ($ _POST ['remoteId ' ]) ? (int )$ _POST ['remoteId ' ] : null ;
137
+ $ remoteId = isset ($ _POST ['remoteId ' ]) ? (string )$ _POST ['remoteId ' ] : null ;
138
138
$ sharedByFederatedId = isset ($ _POST ['sharedByFederatedId ' ]) ? $ _POST ['sharedByFederatedId ' ] : null ;
139
139
$ ownerFederatedId = isset ($ _POST ['ownerFederatedId ' ]) ? $ _POST ['ownerFederatedId ' ] : null ;
140
140
@@ -186,22 +186,19 @@ public function createShare() {
186
186
*
187
187
* create re-share on behalf of another user
188
188
*
189
- * @param int $id
189
+ * @param string $id
190
190
* @return Http\DataResponse
191
191
* @throws OCSBadRequestException
192
192
* @throws OCSException
193
193
* @throws OCSForbiddenException
194
194
*/
195
- public function reShare ($ id ) {
195
+ public function reShare (string $ id ) {
196
196
$ token = $ this ->request ->getParam ('token ' , null );
197
197
$ shareWith = $ this ->request ->getParam ('shareWith ' , null );
198
- $ permission = (int )$ this ->request ->getParam ('permission ' , null );
199
- $ remoteId = (int )$ this ->request ->getParam ('remoteId ' , null );
198
+ $ remoteId = $ this ->request ->getParam ('remoteId ' , null );
200
199
201
- if ($ id === null ||
202
- $ token === null ||
200
+ if ($ token === null ||
203
201
$ shareWith === null ||
204
- $ permission === null ||
205
202
$ remoteId === null
206
203
) {
207
204
throw new OCSBadRequestException ();
@@ -210,7 +207,7 @@ public function reShare($id) {
210
207
$ notification = [
211
208
'sharedSecret ' => $ token ,
212
209
'shareWith ' => $ shareWith ,
213
- 'senderId ' => $ remoteId ,
210
+ 'senderId ' => ( int ) $ remoteId ,
214
211
'message ' => 'Recipient of a share ask the owner to reshare the file '
215
212
];
216
213
@@ -239,13 +236,13 @@ public function reShare($id) {
239
236
*
240
237
* accept server-to-server share
241
238
*
242
- * @param int $id
239
+ * @param string $id
243
240
* @return Http\DataResponse
244
241
* @throws OCSException
245
242
* @throws ShareNotFound
246
243
* @throws \OCP\HintException
247
244
*/
248
- public function acceptShare ($ id ) {
245
+ public function acceptShare (string $ id ) {
249
246
$ token = isset ($ _POST ['token ' ]) ? $ _POST ['token ' ] : null ;
250
247
251
248
$ notification = [
@@ -274,11 +271,11 @@ public function acceptShare($id) {
274
271
*
275
272
* decline server-to-server share
276
273
*
277
- * @param int $id
274
+ * @param string $id
278
275
* @return Http\DataResponse
279
276
* @throws OCSException
280
277
*/
281
- public function declineShare ($ id ) {
278
+ public function declineShare (string $ id ) {
282
279
$ token = isset ($ _POST ['token ' ]) ? $ _POST ['token ' ] : null ;
283
280
284
281
$ notification = [
@@ -307,11 +304,11 @@ public function declineShare($id) {
307
304
*
308
305
* remove server-to-server share if it was unshared by the owner
309
306
*
310
- * @param int $id
307
+ * @param string $id
311
308
* @return Http\DataResponse
312
309
* @throws OCSException
313
310
*/
314
- public function unshare ($ id ) {
311
+ public function unshare (string $ id ) {
315
312
if (!$ this ->isS2SEnabled ()) {
316
313
throw new OCSException ('Server does not support federated cloud sharing ' , 503 );
317
314
}
@@ -343,11 +340,11 @@ private function cleanupRemote($remote) {
343
340
*
344
341
* federated share was revoked, either by the owner or the re-sharer
345
342
*
346
- * @param int $id
343
+ * @param string $id
347
344
* @return Http\DataResponse
348
345
* @throws OCSBadRequestException
349
346
*/
350
- public function revoke ($ id ) {
347
+ public function revoke (string $ id ) {
351
348
$ token = $ this ->request ->getParam ('token ' );
352
349
353
350
try {
@@ -384,11 +381,11 @@ private function isS2SEnabled($incoming = false) {
384
381
*
385
382
* update share information to keep federated re-shares in sync
386
383
*
387
- * @param int $id
384
+ * @param string $id
388
385
* @return Http\DataResponse
389
386
* @throws OCSBadRequestException
390
387
*/
391
- public function updatePermissions ($ id ) {
388
+ public function updatePermissions (string $ id ) {
392
389
$ token = $ this ->request ->getParam ('token ' , null );
393
390
$ ncPermissions = $ this ->request ->getParam ('permissions ' , null );
394
391
@@ -437,12 +434,12 @@ protected function ncPermissions2ocmPermissions($ncPermissions) {
437
434
*
438
435
* change the owner of a server-to-server share
439
436
*
440
- * @param int $id
437
+ * @param string $id
441
438
* @return Http\DataResponse
442
439
* @throws \InvalidArgumentException
443
440
* @throws OCSException
444
441
*/
445
- public function move ($ id ) {
442
+ public function move (string $ id ) {
446
443
if (!$ this ->isS2SEnabled ()) {
447
444
throw new OCSException ('Server does not support federated cloud sharing ' , 503 );
448
445
}
0 commit comments