Code Duplication    Length = 14-15 lines in 2 locations

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

@@ 1627-1641 (lines=15) @@
1624
	 * @param int $operation 1 = add, 2 = modify, 3 = delete.
1625
	 * @return void
1626
	 */
1627
	protected function addChange($calendarId, $objectUri, $operation) {
1628
1629
		$stmt = $this->db->prepare('INSERT INTO `*PREFIX*calendarchanges` (`uri`, `synctoken`, `calendarid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*calendars` WHERE `id` = ?');
1630
		$stmt->execute([
1631
			$objectUri,
1632
			$calendarId,
1633
			$operation,
1634
			$calendarId
1635
		]);
1636
		$stmt = $this->db->prepare('UPDATE `*PREFIX*calendars` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
1637
		$stmt->execute([
1638
			$calendarId
1639
		]);
1640
1641
	}
1642
1643
	/**
1644
	 * Parses some information from calendar objects, used for optimized

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

@@ 842-855 (lines=14) @@
839
	 * @param int $operation 1 = add, 2 = modify, 3 = delete
840
	 * @return void
841
	 */
842
	protected function addChange($addressBookId, $objectUri, $operation) {
843
		$sql = 'INSERT INTO `*PREFIX*addressbookchanges`(`uri`, `synctoken`, `addressbookid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*addressbooks` WHERE `id` = ?';
844
		$stmt = $this->db->prepare($sql);
845
		$stmt->execute([
846
			$objectUri,
847
			$addressBookId,
848
			$operation,
849
			$addressBookId
850
		]);
851
		$stmt = $this->db->prepare('UPDATE `*PREFIX*addressbooks` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
852
		$stmt->execute([
853
			$addressBookId
854
		]);
855
	}
856
857
	private function readBlob($cardData) {
858
		if (is_resource($cardData)) {