Code Duplication    Length = 13-15 lines in 3 locations

lib/Db/GSEventsRequest.php 1 location

@@ 85-97 (lines=13) @@
82
	 * @throws JsonException
83
	 * @throws ModelException
84
	 */
85
	public function getByToken(string $token): GSWrapper {
86
		$qb = $this->getGSEventsSelectSql();
87
		$this->limitToToken($qb, $token);
88
89
		$cursor = $qb->execute();
90
		$data = $cursor->fetch();
91
		$cursor->closeCursor();
92
		if ($data === false) {
93
			throw new TokenDoesNotExistException('Unknown share token');
94
		}
95
96
		return $this->parseGSEventsSelectSql($data);
97
	}
98
99
100
}

lib/Db/TokensRequest.php 1 location

@@ 51-63 (lines=13) @@
48
	 * @return SharesToken
49
	 * @throws TokenDoesNotExistException
50
	 */
51
	public function getByToken(string $token) {
52
		$qb = $this->getTokensSelectSql();
53
		$this->limitToToken($qb, $token);
54
55
		$cursor = $qb->execute();
56
		$data = $cursor->fetch();
57
		$cursor->closeCursor();
58
		if ($data === false) {
59
			throw new TokenDoesNotExistException('Unknown share token');
60
		}
61
62
		return $this->parseTokensSelectSql($data);
63
	}
64
65
66
	/**

lib/ShareByCircleProvider.php 1 location

@@ 434-448 (lines=15) @@
431
	 * @return Share
432
	 * @throws ShareNotFound
433
	 */
434
	public function getShareById($shareId, $recipientId = null) {
435
		$qb = $this->getBaseSelectSql();
436
437
		$this->limitToShare($qb, $shareId);
438
439
		$cursor = $qb->execute();
440
		$data = $cursor->fetch();
441
		$cursor->closeCursor();
442
443
		if ($data === false) {
444
			throw new ShareNotFound();
445
		}
446
447
		return $this->createShareObject($data);
448
	}
449
450
451
	/**