| Conditions | 1 |
| Paths | 1 |
| Total Lines | 10 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 45 | public function findTemplates(User $creator, ?Course $course, ?Session $session) |
||
| 46 | { |
||
| 47 | $qb = $this->getResourcesByCourse($course, $session); |
||
| 48 | |||
| 49 | $this->addCreatorQueryBuilder($creator, $qb); |
||
| 50 | |||
| 51 | return $qb |
||
| 52 | ->andWhere($qb->expr()->eq('resource.isTemplate',true)) |
||
| 53 | ->getQuery() |
||
| 54 | ->getResult() |
||
| 55 | ; |
||
| 58 |
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.