Code Duplication    Length = 5-8 lines in 2 locations

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

@@ 72-76 (lines=5) @@
69
		}
70
71
		// If the backend supports subscriptions, we'll add those as well,
72
		if ($this->caldavBackend instanceof SubscriptionSupport) {
73
			foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
74
				$objects[] = new Subscription($this->caldavBackend, $subscription);
75
			}
76
		}
77
78
		return $objects;
79
	}
@@ 103-110 (lines=8) @@
100
			}
101
		}
102
103
		if ($this->caldavBackend instanceof SubscriptionSupport) {
104
			foreach ($this->caldavBackend->getSubscriptionsForUser($this->principalInfo['uri']) as $subscription) {
105
				if ($subscription['uri'] === $name) {
106
					return new Subscription($this->caldavBackend, $subscription);
107
				}
108
			}
109
110
		}
111
112
		throw new NotFound('Node with name \'' . $name . '\' could not be found');
113
	}