Code Duplication    Length = 6-7 lines in 2 locations

lib/private/legacy/util.php 2 locations

@@ 996-1001 (lines=6) @@
993
	public static function checkDataDirectoryValidity($dataDirectory) {
994
		$l = \OC::$server->getL10N('lib');
995
		$errors = [];
996
		if ($dataDirectory[0] !== '/') {
997
			$errors[] = [
998
				'error' => $l->t('Your Data directory must be an absolute path'),
999
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1000
			];
1001
		}
1002
		if (!\file_exists($dataDirectory . '/.ocdata')) {
1003
			$errors[] = [
1004
				'error' => $l->t('Your Data directory  is invalid'),
@@ 1002-1008 (lines=7) @@
999
				'hint' => $l->t('Check the value of "datadirectory" in your configuration')
1000
			];
1001
		}
1002
		if (!\file_exists($dataDirectory . '/.ocdata')) {
1003
			$errors[] = [
1004
				'error' => $l->t('Your Data directory  is invalid'),
1005
				'hint' => $l->t('Please check that the data directory contains a file' .
1006
					' ".ocdata" in its root.')
1007
			];
1008
		}
1009
		return $errors;
1010
	}
1011