Code Duplication    Length = 12-14 lines in 4 locations

apps/dav/lib/CalDAV/PublicCalendar.php 2 locations

@@ 51-62 (lines=12) @@
48
	/**
49
	 * @return PublicCalendarObject[]
50
	 */
51
	public function getChildren() {
52
		$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']);
53
		$children = [];
54
		foreach ($objs as $obj) {
55
			if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) {
56
				continue;
57
			}
58
			$obj['acl'] = $this->getChildACL();
59
			$children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
60
		}
61
		return $children;
62
	}
63
64
	/**
65
	 * @param string[] $paths
@@ 68-79 (lines=12) @@
65
	 * @param string[] $paths
66
	 * @return PublicCalendarObject[]
67
	 */
68
	public function getMultipleChildren(array $paths) {
69
		$objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths);
70
		$children = [];
71
		foreach ($objs as $obj) {
72
			if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE) {
73
				continue;
74
			}
75
			$obj['acl'] = $this->getChildACL();
76
			$children[] = new PublicCalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
77
		}
78
		return $children;
79
	}
80
81
	/**
82
	 * public calendars are always shared

apps/dav/lib/CalDAV/Calendar.php 2 locations

@@ 249-262 (lines=14) @@
246
247
	}
248
249
	public function getChildren() {
250
251
		$objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']);
252
		$children = [];
253
		foreach ($objs as $obj) {
254
			if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
255
				continue;
256
			}
257
			$obj['acl'] = $this->getChildACL();
258
			$children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
259
		}
260
		return $children;
261
262
	}
263
264
	public function getMultipleChildren(array $paths) {
265
@@ 264-277 (lines=14) @@
261
262
	}
263
264
	public function getMultipleChildren(array $paths) {
265
266
		$objs = $this->caldavBackend->getMultipleCalendarObjects($this->calendarInfo['id'], $paths);
267
		$children = [];
268
		foreach ($objs as $obj) {
269
			if ($obj['classification'] === CalDavBackend::CLASSIFICATION_PRIVATE && $this->isShared()) {
270
				continue;
271
			}
272
			$obj['acl'] = $this->getChildACL();
273
			$children[] = new CalendarObject($this->caldavBackend, $this->calendarInfo, $obj);
274
		}
275
		return $children;
276
277
	}
278
279
	public function childExists($name) {
280
		$obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'], $name);