Conditions | 1 |
Paths | 1 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
18 | 21 | public function connect() |
|
19 | { |
||
20 | $params = [ |
||
21 | 21 | 'path' => $this->config->dbfile, |
|
22 | 21 | 'user' => $this->config->username, |
|
23 | 21 | 'password' => $this->config->password, |
|
24 | 21 | 'driver' => 'pdo_sqlite', |
|
25 | 21 | 'charset' => 'utf8' |
|
26 | ]; |
||
27 | |||
28 | 21 | $config = new Configuration([ |
|
|
|||
29 | 21 | \PDO::ATTR_PERSISTENT => true, |
|
30 | 21 | \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION |
|
31 | ]); |
||
32 | |||
33 | 21 | $this->connection = DriverManager::getConnection($params, $config); |
|
34 | 21 | $this->logger->debug(get_class($this) . " connect."); |
|
35 | } |
||
37 |
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.