| Total Complexity | 3 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class With implements CriteriaInterface |
||
| 12 | { |
||
| 13 | |||
| 14 | protected $with = NULL; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * With constructor. |
||
| 18 | * @param array $with |
||
| 19 | */ |
||
| 20 | public function __construct( array $with = [] ) |
||
| 21 | { |
||
| 22 | $this->with = $with; |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @param mixed $queryBuilder |
||
| 27 | * @return mixed |
||
| 28 | */ |
||
| 29 | public function apply( $queryBuilder ) |
||
| 35 | } |
||
| 36 | |||
| 38 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.