PgSQLConnection::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 8
Ratio 100 %
Metric Value
dl 8
loc 8
rs 9.4285
cc 2
eloc 4
nc 2
nop 1
1
<?php
2
/*
3
 * This file is part of Yolk - Gamer Network's PHP Framework.
4
 *
5
 * Copyright (c) 2014 Gamer Network Ltd.
6
 * 
7
 * Distributed under the MIT License, a copy of which is available in the
8
 * LICENSE file that was bundled with this package, or online at:
9
 * https://github.com/gamernetwork/yolk-database
10
 */
11
12
namespace yolk\database\adapters;
13
14
use yolk\database\BaseConnection;
15
use yolk\database\DSN;
16
use yolk\database\exceptions\ConfigurationException;
17
18 View Code Duplication
class PgSQLConnection extends BaseConnection {
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
19
20
	public function __construct( DSN $dsn ) {
21
22
		if( !$dsn->isPgSQL() )
23
			throw new ConfigurationException(sprintf("\\%s expects a DSN of type '%s', '%s' given", __CLASS__, DSN::TYPE_PGSQL, $dsn->type));
24
25
		parent::__construct($dsn);
26
27
	}
28
29
}
30
31
// EOF