Code Duplication    Length = 15-16 lines in 2 locations

apps/federatedfilesharing/lib/FedShareManager.php 2 locations

@@ 214-228 (lines=15) @@
211
	 * @throws \OCP\Files\InvalidPathException
212
	 * @throws \OCP\Files\NotFoundException
213
	 */
214
	public function acceptShare(IShare $share) {
215
		$uid = $this->getCorrectUid($share);
216
		$fileId = $share->getNode()->getId();
217
		list($file, $link) = $this->getFile($uid, $fileId);
218
		$this->publishActivity(
219
			$uid,
220
			Activity::SUBJECT_REMOTE_SHARE_ACCEPTED,
221
			[$share->getSharedWith(), \basename($file)],
222
			'files',
223
			$fileId,
224
			$file,
225
			$link
226
		);
227
		$this->notifyRemote($share, [$this->notifications, 'sendAcceptShare']);
228
	}
229
230
	/**
231
	 * Delete declined share and create a activity
@@ 238-253 (lines=16) @@
235
	 * @throws \OCP\Files\InvalidPathException
236
	 * @throws \OCP\Files\NotFoundException
237
	 */
238
	public function declineShare(IShare $share) {
239
		$this->notifyRemote($share, [$this->notifications, 'sendDeclineShare']);
240
		$uid = $this->getCorrectUid($share);
241
		$fileId = $share->getNode()->getId();
242
		$this->federatedShareProvider->removeShareFromTable($share);
243
		list($file, $link) = $this->getFile($uid, $fileId);
244
		$this->publishActivity(
245
			$uid,
246
			Activity::SUBJECT_REMOTE_SHARE_DECLINED,
247
			[$share->getSharedWith(), \basename($file)],
248
			'files',
249
			$fileId,
250
			$file,
251
			$link
252
		);
253
	}
254
255
	/**
256
	 * Unshare an item