The expression $entity of type array is implicitly converted to a boolean; are you sure this is intended? If so, consider using ! empty($expr) instead to make it clear that you intend to check for an array without elements.
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.
Loading history...
14
return new AccessRequest($entity);
15
}
16
17
return null;
18
}
19
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}");
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.