| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 14 | public static function getDriver() |
||
| 15 | { |
||
| 16 | if(self::$db == null) { |
||
| 17 | self::$db = \ntentan\atiaa\Driver::getConnection(self::$defaultSettings); |
||
| 18 | self::$db->setCleanDefaults(true); |
||
| 19 | |||
| 20 | try { |
||
| 21 | self::$db->getPDO()->setAttribute(\PDO::ATTR_AUTOCOMMIT, false); |
||
| 22 | } catch (\PDOException $e) { |
||
| 23 | // Just do nothing for drivers which do not allow turning off autocommit |
||
| 24 | } |
||
| 25 | } |
||
| 26 | return self::$db; |
||
| 27 | } |
||
| 28 | |||
| 56 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: