Code Duplication    Length = 8-8 lines in 2 locations

lib/private/Group/Manager.php 2 locations

@@ 242-249 (lines=8) @@
239
		$groups = array();
240
		foreach ($this->backends as $backend) {
241
			$groupIds = $backend->getGroups($search, $limit, $offset);
242
			foreach ($groupIds as $groupId) {
243
				$aGroup = $this->get($groupId);
244
				if ($aGroup instanceof IGroup) {
245
					$groups[$groupId] = $aGroup;
246
				} else {
247
					$this->logger->debug('Group "' . $groupId . '" was returned by search but not found through direct access', ['app' => 'core']);
248
				}
249
			}
250
			if (!is_null($limit) and $limit <= 0) {
251
				return array_values($groups);
252
			}
@@ 280-287 (lines=8) @@
277
		foreach ($this->backends as $backend) {
278
			$groupIds = $backend->getUserGroups($uid);
279
			if (is_array($groupIds)) {
280
				foreach ($groupIds as $groupId) {
281
					$aGroup = $this->get($groupId);
282
					if ($aGroup instanceof IGroup) {
283
						$groups[$groupId] = $aGroup;
284
					} else {
285
						$this->logger->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', ['app' => 'core']);
286
					}
287
				}
288
			}
289
		}
290
		$this->cachedUserGroups[$uid] = $groups;