Code Duplication    Length = 7-7 lines in 2 locations

src/Dialects/MSSQL.php 1 location

@@ 106-112 (lines=7) @@
103
			'timestamp'  => 'datetime2',
104
		][$type] ?? $type;
105
106
		if((is_int($length) || is_string($length) && (count(explode(',', $length)) === 2 || $length === 'max'))
107
		   && in_array($type, ['char', 'varchar', 'nchar', 'nvarchar', 'decimal', 'numeric', 'datetime2', 'time'], true)){
108
			$field[] = $type_translation.'('.$length.')';
109
		}
110
		else{
111
			$field[] = $type_translation;
112
		}
113
114
		if($isNull !== null){
115
			$field[] = $isNull ? 'NULL' : 'NOT NULL';

src/Dialects/Postgres.php 1 location

@@ 148-154 (lines=7) @@
145
			'LONGTEXT'   => 'TEXT',
146
		][$type] ?? $type;
147
148
		if((is_int($length) || is_string($length) && count(explode(',', $length)) === 2)
149
		   && in_array($type, ['BIT', 'VARBIT', 'CHAR', 'VARCHAR', 'DECIMAL', 'NUMERIC', 'TIME', 'TIMESTAMP', 'INTERVAL'], true)){
150
			$field[] = $type_translation.'('.$length.')';
151
		}
152
		else{
153
			$field[] = $type_translation;
154
		}
155
156
		if($collation && in_array($type, ['TINYTEXT', 'TEXT', 'MEDIUMTEXT', 'LONGTEXT', 'VARCHAR', 'CHAR'], true)
157
		   && !in_array(strtolower($collation), ['utf8'], true)){