Code Duplication    Length = 8-15 lines in 3 locations

lib/private/Share20/DefaultShareProvider.php 1 location

@@ 312-326 (lines=15) @@
309
	 *
310
	 * @param \OCP\Share\IShare $share
311
	 */
312
	public function delete(\OCP\Share\IShare $share) {
313
		$qb = $this->dbConn->getQueryBuilder();
314
		$qb->delete('share')
315
			->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())));
316
317
		/*
318
		 * If the share is a group share delete all possible
319
		 * user defined groups shares.
320
		 */
321
		if ($share->getShareType() === \OCP\Share::SHARE_TYPE_GROUP) {
322
			$qb->orWhere($qb->expr()->eq('parent', $qb->createNamedParameter($share->getId())));
323
		}
324
325
		$qb->execute();
326
	}
327
328
	/**
329
	 * Unshare a share from the recipient. If this is a group share

lib/private/DB/MigrationService.php 1 location

@@ 159-173 (lines=15) @@
156
	 * @return string[]
157
	 * @codeCoverageIgnore - no need to test this
158
	 */
159
	public function getMigratedVersions() {
160
		$this->createMigrationTable();
161
		$qb = $this->connection->getQueryBuilder();
162
163
		$qb->select('version')
164
			->from('migrations')
165
			->where($qb->expr()->eq('app', $qb->createNamedParameter($this->getApp())))
166
			->orderBy('version');
167
168
		$result = $qb->execute();
169
		$rows = $result->fetchAll(\PDO::FETCH_COLUMN);
170
		$result->closeCursor();
171
172
		return $rows;
173
	}
174
175
	/**
176
	 * Returns all versions which are available in the migration folder

lib/private/Files/Config/UserMountCache.php 1 location

@@ 202-209 (lines=8) @@
199
		$query->execute();
200
	}
201
202
	private function removeFromCache(ICachedMountInfo $mount) {
203
		$builder = $this->connection->getQueryBuilder();
204
205
		$query = $builder->delete('mounts')
206
			->where($builder->expr()->eq('user_id', $builder->createNamedParameter($mount->getUser()->getUID())))
207
			->andWhere($builder->expr()->eq('root_id', $builder->createNamedParameter($mount->getRootId(), IQueryBuilder::PARAM_INT)));
208
		$query->execute();
209
	}
210
211
	private function dbRowToMountInfo(array $row) {
212
		$user = $this->userManager->get($row['user_id']);