Code Duplication    Length = 13-18 lines in 3 locations

lib/Db/CirclesRequest.php 1 location

@@ 111-128 (lines=18) @@
108
	 * @return null|Circle
109
	 * @throws CircleDoesNotExistException
110
	 */
111
	public function forceGetCircleByName($name) {
112
113
		$qb = $this->getCirclesSelectSql();
114
115
		$this->limitToName($qb, $name);
116
117
		$cursor = $qb->execute();
118
		$data = $cursor->fetch();
119
		$cursor->closeCursor();
120
121
		if ($data === false) {
122
			throw new CircleDoesNotExistException($this->l10n->t('Circle not found'));
123
		}
124
125
		$entry = $this->parseCirclesSelectSql($data);
126
127
		return $entry;
128
	}
129
130
131
	/**

lib/Db/SharesRequest.php 1 location

@@ 74-87 (lines=14) @@
71
	 * @return string
72
	 * @throws TokenDoesNotExistException
73
	 */
74
	public function getTokenByShareId(int $shareId) {
75
		$qb = $this->getSharesSelectSql();
76
		$this->limitToId($qb, $shareId);
77
		$this->limitToShareType($qb, self::SHARE_TYPE);
78
79
		$cursor = $qb->execute();
80
		$data = $cursor->fetch();
81
		$cursor->closeCursor();
82
		if ($data === false) {
83
			throw new TokenDoesNotExistException('Unknown share token');
84
		}
85
86
		return $this->get('token', $data, 'notfound');
87
	}
88
89
90
	/**

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
	/**