Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2.0932 |
Changes | 0 |
1 | <?php |
||
14 | 1 | public function __construct($driver = null) |
|
15 | { |
||
16 | 1 | if ($driver) { |
|
|
|||
17 | 1 | $this->code = static::CODE_UNSUPPORTED; |
|
18 | 1 | $this->message = "\"{$driver}\" is not supported."; |
|
19 | } else { |
||
20 | $this->code = static::CODE_UNDEFINED; |
||
21 | $this->message = "driver is not defined."; |
||
22 | } |
||
23 | 1 | } |
|
24 | } |
||
25 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: