Code Duplication    Length = 11-11 lines in 2 locations

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;

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

@@ 330-340 (lines=11) @@
327
			}
328
329
			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
330
			if (isset($calendars[$row['id']])) {
331
				if ($readOnly) {
332
					// New share can not have more permissions then the old one.
333
					continue;
334
				}
335
				if (isset($calendars[$row['id']][$readOnlyPropertyName]) &&
336
					$calendars[$row['id']][$readOnlyPropertyName] === 0) {
337
					// Old share is already read-write, no more permissions can be gained
338
					continue;
339
				}
340
			}
341
342
			list(, $name) = Uri\split($row['principaluri']);
343
			$uri = $row['uri'] . '_shared_by_' . $name;