Code Duplication    Length = 16-17 lines in 2 locations

apps/federatedfilesharing/lib/Controller/RequestHandlerController.php 2 locations

@@ 262-277 (lines=16) @@
259
	 *
260
	 * @return Result
261
	 */
262
	public function acceptShare($id) {
263
		try {
264
			$this->assertOutgoingSharingEnabled();
265
			$share = $this->getValidShare($id);
266
			$this->fedShareManager->acceptShare($share);
267
		} catch (NotSupportedException $e) {
268
			return new Result(
269
				null,
270
				Http::STATUS_SERVICE_UNAVAILABLE,
271
				'Server does not support federated cloud sharing'
272
			);
273
		} catch (Share\Exceptions\ShareNotFound $e) {
274
			// pass
275
		}
276
		return new Result();
277
	}
278
279
	/**
280
	 * @NoCSRFRequired
@@ 289-305 (lines=17) @@
286
	 *
287
	 * @return Result
288
	 */
289
	public function declineShare($id) {
290
		try {
291
			$this->assertOutgoingSharingEnabled();
292
			$share = $this->getValidShare($id);
293
			$this->fedShareManager->declineShare($share);
294
		} catch (NotSupportedException $e) {
295
			return new Result(
296
				null,
297
				Http::STATUS_SERVICE_UNAVAILABLE,
298
				'Server does not support federated cloud sharing'
299
			);
300
		} catch (Share\Exceptions\ShareNotFound $e) {
301
			// pass
302
		}
303
304
		return new Result();
305
	}
306
307
	/**
308
	 * @NoCSRFRequired