zendframework/zend-db

Initializing a result set with empty array produces warning on PHP 7.2

hschletz opened this issue · 3 comments

This produces a warning on PHP 7.2:

$input = array(); // May actually be the result of another operation
$resultSet = new \Zend\Db\ResultSet\ResultSet;
$resultSet->initialize($input);

count(): Parameter must be an array or an object that implements Countable

in ResultSet/AbstractResultSet.php, line 80

Since initializing a ResultSet with an array is perfectly valid, an empty array should be accounted for.

@hschletz I've created PR #303 for it

@samsonasik #295 issue not pull request
incorrect now https://github.com/zendframework/zend-db/pull/295

correct https://github.com/zendframework/zend-db/pull/303

I can revert the changelog link if that is actually needed ;)