| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | function fetchAll($limit = 20, $offset = 0) { |
||
| 21 | $limit = (int) $limit; |
||
| 22 | $offset = (int) $offset; |
||
| 23 | |||
| 24 | $return = []; |
||
| 25 | $entities = get_data("SELECT * FROM pleio_request_access ORDER BY time_created DESC LIMIT {$offset}, {$limit}"); |
||
| 26 | foreach ($entities as $entity) { |
||
| 27 | $return[] = new AccessRequest($entity); |
||
| 28 | } |
||
| 29 | |||
| 30 | return $return; |
||
| 31 | } |
||
| 32 | } |
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.