| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 2 |
| 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 | 1 | } else { |
|
| 20 | 1 | $this->code = static::CODE_UNDEFINED; |
|
| 21 | 1 | $this->message = "driver is not defined."; |
|
| 22 | } |
||
| 23 | 1 | } |
|
| 24 | } |
||
| 25 |
In PHP, under loose comparison (like
==, or!=, orswitchconditions), values of different types might be equal.For
stringvalues, the empty string''is a special case, in particular the following results might be unexpected: