Code Duplication    Length = 14-15 lines in 2 locations

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

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

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

@@ 2005-2019 (lines=15) @@
2002
	 * @param int $operation 1 = add, 2 = modify, 3 = delete.
2003
	 * @return void
2004
	 */
2005
	protected function addChange($calendarId, $objectUri, $operation) {
2006
2007
		$stmt = $this->db->prepare('INSERT INTO `*PREFIX*calendarchanges` (`uri`, `synctoken`, `calendarid`, `operation`) SELECT ?, `synctoken`, ?, ? FROM `*PREFIX*calendars` WHERE `id` = ?');
2008
		$stmt->execute([
2009
			$objectUri,
2010
			$calendarId,
2011
			$operation,
2012
			$calendarId
2013
		]);
2014
		$stmt = $this->db->prepare('UPDATE `*PREFIX*calendars` SET `synctoken` = `synctoken` + 1 WHERE `id` = ?');
2015
		$stmt->execute([
2016
			$calendarId
2017
		]);
2018
2019
	}
2020
2021
	/**
2022
	 * Parses some information from calendar objects, used for optimized