Code Duplication    Length = 7-7 lines in 2 locations

lib/private/Setup/AbstractDatabase.php 1 location

@@ 64-70 (lines=7) @@
61
62
	public function validate($config) {
63
		$errors = [];
64
		if (empty($config['dbuser']) && empty($config['dbname'])) {
65
			$errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
66
		} elseif (empty($config['dbuser'])) {
67
			$errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
68
		} elseif (empty($config['dbname'])) {
69
			$errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
70
		}
71
		if (\substr_count($config['dbname'], '.') >= 1) {
72
			$errors[] = $this->trans->t("%s you may not use dots in the database name", [$this->dbprettyname]);
73
		}

lib/private/Setup/OCI.php 1 location

@@ 54-60 (lines=7) @@
51
52
	public function validate($config) {
53
		$errors = [];
54
		if (empty($config['dbuser']) && empty($config['dbname'])) {
55
			$errors[] = $this->trans->t("%s enter the database username and name.", [$this->dbprettyname]);
56
		} elseif (empty($config['dbuser'])) {
57
			$errors[] = $this->trans->t("%s enter the database username.", [$this->dbprettyname]);
58
		} elseif (empty($config['dbname'])) {
59
			$errors[] = $this->trans->t("%s enter the database name.", [$this->dbprettyname]);
60
		}
61
		return $errors;
62
	}
63