Code Duplication    Length = 17-18 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 449-466 (lines=18) @@
446
	 * @param IShare $parent
447
	 * @return IShare[]
448
	 */
449
	public function getChildren(IShare $parent) {
450
		$children = [];
451
452
		$qb = $this->dbConnection->getQueryBuilder();
453
		$qb->select('*')
454
			->from($this->shareTable)
455
			->where($qb->expr()->eq('parent', $qb->createNamedParameter($parent->getId())))
456
			->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE_REMOTE)))
457
			->orderBy('id');
458
459
		$cursor = $qb->execute();
460
		while ($data = $cursor->fetch()) {
461
			$children[] = $this->createShareObject($data);
462
		}
463
		$cursor->closeCursor();
464
465
		return $children;
466
	}
467
468
	/**
469
	 * Delete a share (owner unShares the file)
@@ 706-722 (lines=17) @@
703
	 * @param \OCP\Files\Node $path
704
	 * @return IShare[]
705
	 */
706
	public function getSharesByPath(Node $path) {
707
		$qb = $this->dbConnection->getQueryBuilder();
708
709
		$cursor = $qb->select('*')
710
			->from($this->shareTable)
711
			->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($path->getId())))
712
			->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE_REMOTE)))
713
			->execute();
714
715
		$shares = [];
716
		while ($data = $cursor->fetch()) {
717
			$shares[] = $this->createShareObject($data);
718
		}
719
		$cursor->closeCursor();
720
721
		return $shares;
722
	}
723
724
	/**
725
	 * @inheritdoc