| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | 57 | public function __construct($path = null) |
|
| 26 | { |
||
| 27 | 57 | $this->loadEnv($path); |
|
| 28 | |||
| 29 | 57 | $this->servername = getenv('DB_HOST'); |
|
| 30 | 57 | $this->username = getenv('DB_USERNAME'); |
|
| 31 | 57 | $this->password = getenv('DB_PASSWORD'); |
|
| 32 | 57 | $this->driver = getenv('DB_DRIVER'); |
|
| 33 | 57 | $this->dbname = getenv('DB_NAME'); |
|
| 34 | |||
| 35 | $options = [ |
||
|
|
|||
| 36 | 57 | PDO::ATTR_PERSISTENT => true, |
|
| 37 | 38 | PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, |
|
| 38 | 38 | ]; |
|
| 39 | |||
| 40 | //parent::__construct($this->getDataBaseDriver(), $this->username, $this->password, $options); |
||
| 41 | 57 | } |
|
| 42 | |||
| 66 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.