Closed bitwombat closed 6 years ago
@bitwombat In case $params
can be only array|null
and we check count($params) != 0
we can replace if with simply if ($params)
and it will give us exactly the same result.
PR is very welcome ! 👍
Fixed in #63
Beat me to it! Good work.
This line and similar:
https://github.com/zendframework/zend-test/blob/master/src/PHPUnit/Controller/AbstractControllerTestCase.php#L252
Rely on count, whose behavior has changed in PHP 7.2: http://php.net/manual/en/migration72.incompatible.php#migration72.incompatible.warn-on-non-countable-types
I think the fix is a simple boolean, taking advantage of short-circuit and behavior:
$params_exist = ( (null !==$params) && (count($params) > 0));
Will make that a PR if I'm not off the mark.