Code Duplication    Length = 4-5 lines in 2 locations

maphper/datasource/mysqladapter.php 1 location

@@ 41-44 (lines=4) @@
38
	}
39
40
	private function getType($val) {
41
		if ($val instanceof \DateTime) return 'DATETIME';
42
		else if (is_int($val)) return  'INT(11)';
43
		else if (is_double($val)) return 'DECIMAL(9,' . strlen($val) - strrpos($val, '.') - 1 . ')';
44
		else if (is_string($val)) return strlen($val) < 192 ? 'VARCHAR(191)' : 'LONGBLOB';
45
		return 'VARCHAR(191)';
46
	}
47

maphper/datasource/sqliteadapter.php 1 location

@@ 58-62 (lines=5) @@
55
	
56
	private function getType($val) {
57
		if ($val instanceof \DateTime) return 'DATETIME';
58
		else if (is_int($val)) return  'INTEGER';
59
		else if (is_double($val)) return 'DECIMAL(9,' . strlen($val) - strrpos($val, '.') - 1 . ')';
60
		else if (is_string($val) && strlen($val) < 256) return 'VARCHAR(255)';
61
		else if (is_string($val) && strlen($val) > 256) return 'LONGBLOG';
62
		else return 'VARCHAR(255)';		
63
	}
64
65
	private function tableExists($name) {