| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | 25 | public function connect() |
|
| 22 | { |
||
| 23 | $params = [ |
||
| 24 | 25 | 'path' => $this->config->dbfile, |
|
| 25 | 25 | 'user' => $this->config->username, |
|
| 26 | 25 | 'password' => $this->config->password, |
|
| 27 | 25 | 'driver' => 'pdo_sqlite', |
|
| 28 | 25 | 'charset' => 'utf8' |
|
| 29 | ]; |
||
| 30 | |||
| 31 | 25 | $config = new Configuration([ |
|
|
|
|||
| 32 | 25 | \PDO::ATTR_PERSISTENT => true, |
|
| 33 | \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION |
||
| 34 | ]); |
||
| 35 | |||
| 36 | 25 | $this->connection = DriverManager::getConnection($params, $config); |
|
| 37 | 25 | $this->logger->debug(get_class($this) . " connect."); |
|
| 38 | 25 | } |
|
| 40 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.