| Conditions | 3 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | public function connect(#[SensitiveParameter] array $params): DriverInterface\Connection |
||
| 23 | { |
||
| 24 | if ($this->logSql) { |
||
| 25 | _log()->debug('Connecting to DB', $this->maskPassword($params)); |
||
| 26 | } |
||
| 27 | |||
| 28 | // Don't bother to wrap the connection if we will never log SQL queries to file... |
||
| 29 | $connection = parent::connect($params); |
||
| 30 | if ($this->logSql) { |
||
| 31 | $connection = new Connection($connection); |
||
| 32 | } |
||
| 33 | |||
| 34 | // ... but always notify that we are now connected. so we can log other things to DB |
||
| 35 | $this->dbHandler->enable(); |
||
| 36 | |||
| 37 | return $connection; |
||
| 38 | } |
||
| 54 |