Code Duplication    Length = 13-15 lines in 2 locations

lib/Db/SharesRequest.php 1 location

@@ 66-80 (lines=15) @@
63
	 *
64
	 * @return array
65
	 */
66
	public function getSharesForCircle(string $circleId) {
67
		$qb = $this->getSharesSelectSql();
68
69
		$this->limitToShareWith($qb, $circleId);
70
		$this->limitToShareType($qb, self::SHARE_TYPE);
71
72
		$shares = [];
73
		$cursor = $qb->execute();
74
		while ($data = $cursor->fetch()) {
75
			$shares[] = $data;
76
		}
77
		$cursor->closeCursor();
78
79
		return $shares;
80
	}
81
82
}
83

lib/ShareByCircleProvider.php 1 location

@@ 354-366 (lines=13) @@
351
	 *
352
	 * @return Share[]
353
	 */
354
	public function getSharesInFolder($userId, Folder $node, $reshares) {
355
		$qb = $this->getBaseSelectSql();
356
		$this->limitToShareOwner($qb, $userId, true);
357
		$cursor = $qb->execute();
358
359
		$shares = [];
360
		while ($data = $cursor->fetch()) {
361
			$shares[$data['file_source']][] = $this->createShareObject($data);
362
		}
363
		$cursor->closeCursor();
364
365
		return $shares;
366
	}
367
368
369
	/**