Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 1004-1009 (lines=6) @@
1001
	public static function checkDataDirectoryValidity($dataDirectory) {
1002
		$l = \OC::$server->getL10N('lib');
1003
		$errors = [];
1004
		if ($dataDirectory[0] !== '/') {
1005
			$errors[] = [
1006
				'error' => $l->t('Your data directory must be an absolute path'),
1007
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1008
			];
1009
		}
1010
		if (!file_exists($dataDirectory . '/.ocdata')) {
1011
			$errors[] = [
1012
				'error' => $l->t('Your data directory is invalid'),
@@ 1010-1016 (lines=7) @@
1007
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1008
			];
1009
		}
1010
		if (!file_exists($dataDirectory . '/.ocdata')) {
1011
			$errors[] = [
1012
				'error' => $l->t('Your data directory is invalid'),
1013
				'hint' => $l->t('Ensure there is a file called ".ocdata"' .
1014
					' in the root of the data directory.')
1015
			];
1016
		}
1017
		return $errors;
1018
	}
1019