| Conditions | 3 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function __construct(IRelationDefinition $relationDefinition, $cond, ...$args) |
||
| 20 | { |
||
| 21 | if ($cond instanceof ISqlPredicate && $args) { |
||
|
|
|||
| 22 | throw new \InvalidArgumentException('$args not supported for ' . ISqlPredicate::class . ' condition'); |
||
| 23 | } |
||
| 24 | |||
| 25 | |||
| 26 | $this->baseRelDef = $relationDefinition; |
||
| 27 | $this->cond = $cond; |
||
| 28 | $this->args = $args; |
||
| 29 | } |
||
| 30 | |||
| 45 |
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.