Skip to content

Commit

Permalink
変数がCountableでない場合のWARNING抑止
Browse files Browse the repository at this point in the history
  • Loading branch information
miyaz committed Aug 1, 2018
1 parent 154f80a commit be86cb6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Plugin/Smarty/modifier.count.php
Expand Up @@ -19,5 +19,8 @@
*/
function smarty_modifier_count($array)
{
return count($array);
if (is_array($array)) {
return count($array);
}
return 0;
}

0 comments on commit be86cb6

Please sign in to comment.