Code Duplication    Length = 11-11 lines in 2 locations

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

@@ 184-194 (lines=11) @@
181
			}
182
183
			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
184
			if (isset($addressBooks[$row['id']])) {
185
				if ($readOnly) {
186
					// New share can not have more permissions then the old one.
187
					continue;
188
				}
189
				if (isset($addressBooks[$row['id']][$readOnlyPropertyName]) &&
190
					$addressBooks[$row['id']][$readOnlyPropertyName] === 0) {
191
					// Old share is already read-write, no more permissions can be gained
192
					continue;
193
				}
194
			}
195
196
			list(, $name) = URLUtil::splitPath($row['principaluri']);
197
			$uri = $row['uri'] . '_shared_by_' . $name;

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

@@ 306-316 (lines=11) @@
303
			}
304
305
			$readOnly = (int) $row['access'] === Backend::ACCESS_READ;
306
			if (isset($calendars[$row['id']])) {
307
				if ($readOnly) {
308
					// New share can not have more permissions then the old one.
309
					continue;
310
				}
311
				if (isset($calendars[$row['id']][$readOnlyPropertyName]) &&
312
					$calendars[$row['id']][$readOnlyPropertyName] === 0) {
313
					// Old share is already read-write, no more permissions can be gained
314
					continue;
315
				}
316
			}
317
318
			list(, $name) = URLUtil::splitPath($row['principaluri']);
319
			$uri = $row['uri'] . '_shared_by_' . $name;