Code Duplication    Length = 5-6 lines in 2 locations

src/DSN.php 2 locations

@@ 146-151 (lines=6) @@
143
144
		$str = $this->config['type']. '://';
145
146
		if( $this->config['user'] ) {
147
			$str .= $this->config['user'];
148
			if( $this->config['pass'] )
149
				$str .= ':'. $this->config['pass'];
150
			$str .= '@';
151
		}
152
153
		if( $this->config['host'] ) {
154
			$str .= $this->config['host'];
@@ 153-157 (lines=5) @@
150
			$str .= '@';
151
		}
152
153
		if( $this->config['host'] ) {
154
			$str .= $this->config['host'];
155
			if( $this->config['port'] )
156
				$str .= ':'. $this->config['port'];
157
		}
158
159
		$str .= '/'. $this->config['db'];
160