| Conditions | 3 |
| Paths | 4 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 50 | 1 | protected static function range($query, $attribute, $start = null, $end = null) |
|
| 51 | { |
||
| 52 | 1 | if (!empty($start)) { |
|
| 53 | 1 | $query = $query->andWhere(['>=', $attribute, $start]); |
|
| 54 | 1 | } |
|
| 55 | 1 | if (!empty($end)) { |
|
| 56 | 1 | $query = $query->andWhere(['<', $attribute, $end]); |
|
| 57 | 1 | } |
|
| 58 | 1 | return $query; |
|
| 59 | } |
||
| 60 | } |
||
| 61 |
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: