Code Duplication    Length = 6-9 lines in 2 locations

apps/user_ldap/lib/wizard.php 2 locations

@@ 448-453 (lines=6) @@
445
			$offset += $limit;
446
		} while ($this->access->hasMoreResults());
447
448
		if(count($groupNames) > 0) {
449
			natsort($groupNames);
450
			$this->result->addOptions($dbKey, array_values($groupNames));
451
		} else {
452
			throw new \Exception(self::$l->t('Could not find the desired feature'));
453
		}
454
455
		$setFeatures = $this->configuration->$confKey;
456
		if(is_array($setFeatures) && !empty($setFeatures)) {
@@ 1222-1230 (lines=9) @@
1219
		$availableFeatures =
1220
			$this->cumulativeSearchOnAttribute($objectclasses, $attr,
1221
											   $dig, $maxEntryObjC);
1222
		if(is_array($availableFeatures)
1223
		   && count($availableFeatures) > 0) {
1224
			natcasesort($availableFeatures);
1225
			//natcasesort keeps indices, but we must get rid of them for proper
1226
			//sorting in the web UI. Therefore: array_values
1227
			$this->result->addOptions($dbkey, array_values($availableFeatures));
1228
		} else {
1229
			throw new \Exception(self::$l->t('Could not find the desired feature'));
1230
		}
1231
1232
		$setFeatures = $this->configuration->$confkey;
1233
		if(is_array($setFeatures) && !empty($setFeatures)) {