Code Duplication    Length = 17-18 lines in 2 locations

apps/federatedfilesharing/lib/FederatedShareProvider.php 2 locations

@@ 459-476 (lines=18) @@
456
	 * @param IShare $parent
457
	 * @return IShare[]
458
	 */
459
	public function getChildren(IShare $parent) {
460
		$children = [];
461
462
		$qb = $this->dbConnection->getQueryBuilder();
463
		$qb->select('*')
464
			->from($this->shareTable)
465
			->where($qb->expr()->eq('parent', $qb->createNamedParameter($parent->getId())))
466
			->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE_REMOTE)))
467
			->orderBy('id');
468
469
		$cursor = $qb->execute();
470
		while ($data = $cursor->fetch()) {
471
			$children[] = $this->createShareObject($data);
472
		}
473
		$cursor->closeCursor();
474
475
		return $children;
476
	}
477
478
	/**
479
	 * Delete a share (owner unShares the file)
@@ 716-732 (lines=17) @@
713
	 * @param \OCP\Files\Node $path
714
	 * @return IShare[]
715
	 */
716
	public function getSharesByPath(Node $path) {
717
		$qb = $this->dbConnection->getQueryBuilder();
718
719
		$cursor = $qb->select('*')
720
			->from($this->shareTable)
721
			->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($path->getId())))
722
			->andWhere($qb->expr()->eq('share_type', $qb->createNamedParameter(self::SHARE_TYPE_REMOTE)))
723
			->execute();
724
725
		$shares = [];
726
		while ($data = $cursor->fetch()) {
727
			$shares[] = $this->createShareObject($data);
728
		}
729
		$cursor->closeCursor();
730
731
		return $shares;
732
	}
733
734
	/**
735
	 * @inheritdoc