Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 317-327 (lines=11) @@
314
			}
315
316
			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
317
			if (isset($calendars[$row['id']])) {
318
				if ($readOnly) {
319
					// New share can not have more permissions then the old one.
320
					continue;
321
				}
322
				if (isset($calendars[$row['id']][$readOnlyPropertyName]) &&
323
					$calendars[$row['id']][$readOnlyPropertyName] === 0) {
324
					// Old share is already read-write, no more permissions can be gained
325
					continue;
326
				}
327
			}
328
329
			list(, $name) = Uri\split($row['principaluri']);
330
			$uri = $row['uri'] . '_shared_by_' . $name;

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

@@ 195-205 (lines=11) @@
192
			}
193
194
			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
195
			if (isset($addressBooks[$row['id']])) {
196
				if ($readOnly) {
197
					// New share can not have more permissions then the old one.
198
					continue;
199
				}
200
				if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
201
					$addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
202
					// Old share is already read-write, no more permissions can be gained
203
					continue;
204
				}
205
			}
206
207
			list(, $name) = \Sabre\Uri\split($row['principaluri']);
208
			$uri = $row['uri'] . '_shared_by_' . $name;