Conditions | 2 |
Paths | 2 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 2.2559 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | 33 | public static function getDriverClassName($driver) { |
|
31 | 33 | if ($driver == null) { |
|
32 | throw new exceptions\DatabaseDriverException( |
||
33 | "Please provide a valid driver name in your database config file" |
||
34 | ); |
||
35 | } |
||
36 | 33 | return '\ntentan\atiaa\drivers\\' . Text::ucamelize($driver) . "Driver"; |
|
37 | } |
||
38 | |||
44 |
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: