Code Duplication    Length = 14-15 lines in 2 locations

apps/dav/lib/CalDAV/CalDavBackend.php 1 location

@@ 1492-1506 (lines=15) @@
1489
	 * @param int $operation 1 = add, 2 = modify, 3 = delete.
1490
	 * @return void
1491
	 */
1492
	protected function addChange($calendarId, $objectUri, $operation) {
1493
1494
		$stmt = $this->db->prepare('INSERT INTO `*PREFIX*calendarchanges` (`uri`, `synctoken`, `calendarid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*calendars` WHERE `id` = ?');
1495
		$stmt->execute([
1496
			$objectUri,
1497
			$calendarId,
1498
			$operation,
1499
			$calendarId
1500
		]);
1501
		$stmt = $this->db->prepare('UPDATE `*PREFIX*calendars` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
1502
		$stmt->execute([
1503
			$calendarId
1504
		]);
1505
1506
	}
1507
1508
	/**
1509
	 * Parses some information from calendar objects, used for optimized

apps/dav/lib/CardDAV/CardDavBackend.php 1 location

@@ 771-784 (lines=14) @@
768
	 * @param int $operation 1 = add, 2 = modify, 3 = delete
769
	 * @return void
770
	 */
771
	protected function addChange($addressBookId, $objectUri, $operation) {
772
		$sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
773
		$stmt = $this->db->prepare($sql);
774
		$stmt->execute([
775
			$objectUri,
776
			$addressBookId,
777
			$operation,
778
			$addressBookId
779
		]);
780
		$stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
781
		$stmt->execute([
782
			$addressBookId
783
		]);
784
	}
785
786
	private function readBlob($cardData) {
787
		if (is_resource($cardData)) {