Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 923-928 (lines=6) @@
920
	public static function checkDataDirectoryValidity($dataDirectory) {
921
		$l = \OC::$server->getL10N('lib');
922
		$errors = [];
923
		if ($dataDirectory[0] !== '/') {
924
			$errors[] = [
925
				'error' => $l->t('Your Data directory must be an absolute path'),
926
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
927
			];
928
		}
929
		if (!file_exists($dataDirectory . '/.ocdata')) {
930
			$errors[] = [
931
				'error' => $l->t('Your Data directory  is invalid'),
@@ 929-935 (lines=7) @@
926
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
927
			];
928
		}
929
		if (!file_exists($dataDirectory . '/.ocdata')) {
930
			$errors[] = [
931
				'error' => $l->t('Your Data directory  is invalid'),
932
				'hint' => $l->t('Please check that the data directory contains a file' .
933
					' ".ocdata" in its root.')
934
			];
935
		}
936
		return $errors;
937
	}
938