Running under PHP 7.2, the ErrorHandlingSniff can emit this error if there are no param tokens:
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | An error occurred during processing; checking has been aborted. The error message was: count(): Parameter must be an array or an object that implements
| | Countable in /path/to/vendor/pheromone/phpcs-security-audit/Security/Sniffs/BadFunctions/ErrorHandlingSniff.php on
| | line 34 (Internal.Exception)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
In the process method, the count($p) crashes if $p is NULL:
Running under PHP 7.2, the
ErrorHandlingSniff
can emit this error if there are no param tokens:In the
process
method, thecount($p)
crashes if$p
isNULL
:Add a null check to make sure that
$p
is countable.