Fix: Parameter must be an array or an object that implements Countable
This commit is contained in:
parent
3445c9d329
commit
6cac4b15d3
@ -49,7 +49,7 @@ function dol_json_encode($elements)
|
|||||||
{
|
{
|
||||||
dol_syslog('dol_json_encode() is deprecated. Please update your code to use native json_encode().', LOG_WARNING);
|
dol_syslog('dol_json_encode() is deprecated. Please update your code to use native json_encode().', LOG_WARNING);
|
||||||
|
|
||||||
$num=count($elements);
|
$num = (is_null($elements) ? 0 : count($elements)); // for avoid phpunit error : "Parameter must be an array or an object that implements Countable"
|
||||||
if (is_object($elements)) // Count number of properties for an object
|
if (is_object($elements)) // Count number of properties for an object
|
||||||
{
|
{
|
||||||
$num=0;
|
$num=0;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user