Code Duplication    Length = 6-6 lines in 2 locations

apps/dav/lib/Connector/Sabre/Principal.php 2 locations

@@ 233-238 (lines=6) @@
230
231
					$results[] = array_reduce($users, function(array $carry, IUser $user) use ($restrictGroups) {
232
						// is sharing restricted to groups only?
233
						if ($restrictGroups !== false) {
234
							$userGroups = $this->groupManager->getUserGroupIds($user);
235
							if (count(array_intersect($userGroups, $restrictGroups)) === 0) {
236
								return $carry;
237
							}
238
						}
239
240
						$carry[] = $this->principalPrefix . '/' . $user->getUID();
241
						return $carry;
@@ 318-323 (lines=6) @@
315
				}
316
				$user = $users[0];
317
318
				if ($restrictGroups !== false) {
319
					$userGroups = $this->groupManager->getUserGroupIds($user);
320
					if (count(array_intersect($userGroups, $restrictGroups)) === 0) {
321
						return null;
322
					}
323
				}
324
325
				return $this->principalPrefix . '/' . $user->getUID();
326
			}