PHPStan level 9 (apstats config) reports at htdocs/cron/list.php:363: "Variable $filter might not be defined." $filter was only initialized inside the "if (empty($reshook))" Actions block, but it is used unconditionally later to build the SQL WHERE clause. When a hook intercepts the Actions section ($reshook not empty), $filter stayed undefined. Initialize it with the other search criteria so it is always defined. As $filter is now always an array, the "is_array($filter)" guard becomes redundant (it would raise a level 10 'always evaluate to true' warning), so the condition is simplified to "count($filter) > 0". No behaviour change. Co-authored-by: Muvikx <kilyan.cotten@epitech.eu> |
||
|---|---|---|
| .. | ||
| admin | ||
| class | ||
| card.php | ||
| info.php | ||
| list.php | ||