Code Duplication    Length = 8-8 lines in 2 locations

lib/private/Group/Manager.php 2 locations

@@ 233-240 (lines=8) @@
230
		$groups = array();
231
		foreach ($this->backends as $backend) {
232
			$groupIds = $backend->getGroups($search, $limit, $offset);
233
			foreach ($groupIds as $groupId) {
234
				$aGroup = $this->get($groupId);
235
				if ($aGroup instanceof IGroup) {
236
					$groups[$groupId] = $aGroup;
237
				} else {
238
					$this->logger->debug('Group "' . $groupId . '" was returned by search but not found through direct access', ['app' => 'core']);
239
				}
240
			}
241
			if (!is_null($limit) and $limit <= 0) {
242
				return array_values($groups);
243
			}
@@ 271-278 (lines=8) @@
268
		foreach ($this->backends as $backend) {
269
			$groupIds = $backend->getUserGroups($uid);
270
			if (is_array($groupIds)) {
271
				foreach ($groupIds as $groupId) {
272
					$aGroup = $this->get($groupId);
273
					if ($aGroup instanceof IGroup) {
274
						$groups[$groupId] = $aGroup;
275
					} else {
276
						$this->logger->debug('User "' . $uid . '" belongs to deleted group: "' . $groupId . '"', ['app' => 'core']);
277
					}
278
				}
279
			}
280
		}
281
		$this->cachedUserGroups[$uid] = $groups;