Code Duplication    Length = 17-18 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 450-467 (lines=18) @@
447
	 * @param IShare $parent
448
	 * @return IShare[]
449
	 */
450
	public function getChildren(IShare $parent) {
451
		$children = [];
452
453
		$qb = $this->dbConnection->getQueryBuilder();
454
		$qb->select('*')
455
			->from('share')
456
			->where($qb->expr()->eq('parent', $qb->createNamedParameter($parent->getId())))
457
			->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE_REMOTE)))
458
			->orderBy('id');
459
460
		$cursor = $qb->execute();
461
		while($data = $cursor->fetch()) {
462
			$children[] = $this->createShareObject($data);
463
		}
464
		$cursor->closeCursor();
465
466
		return $children;
467
	}
468
469
	/**
470
	 * Delete a share (owner unShares the file)
@@ 653-669 (lines=17) @@
650
	 * @param \OCP\Files\Node $path
651
	 * @return IShare[]
652
	 */
653
	public function getSharesByPath(Node $path) {
654
		$qb = $this->dbConnection->getQueryBuilder();
655
656
		$cursor = $qb->select('*')
657
			->from('share')
658
			->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($path->getId())))
659
			->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE_REMOTE)))
660
			->execute();
661
662
		$shares = [];
663
		while($data = $cursor->fetch()) {
664
			$shares[] = $this->createShareObject($data);
665
		}
666
		$cursor->closeCursor();
667
668
		return $shares;
669
	}
670
671
	/**
672
	 * @inheritdoc