Fix PHP count(): Value Must Be Countable
An empty array is valid input to count() and returns zero. This warning means the runtime value is null, scalar, or otherwise non-countable; find where the type contract broke, then fix or normalize it intentionally.