| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | public function toSql(ITypeDictionary $typeDictionary): string |
||
| 32 | { |
||
| 33 | $relSql = $this->baseRelDef->toSql($typeDictionary); |
||
| 34 | |||
| 35 | if ($this->cond instanceof ISqlPredicate) { |
||
| 36 | $condSql = $this->cond->getSql(); |
||
| 37 | } else { |
||
| 38 | $condDef = SqlRelationDefinition::fromPattern($this->cond, ...$this->args); |
||
| 39 | $condSql = $condDef->toSql($typeDictionary); |
||
| 40 | } |
||
| 41 | |||
| 42 | return "SELECT *\nFROM (\n$relSql\n) t\nWHERE $condSql"; |
||
| 43 | } |
||
| 44 | } |
||
| 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.