mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-08 16:36:58 +00:00
Use is_countable()
This commit is contained in:
@@ -1119,7 +1119,7 @@ function twig_length_filter(Environment $env, $thing)
|
||||
return mb_strlen($thing, $env->getCharset());
|
||||
}
|
||||
|
||||
if ($thing instanceof \Countable || \is_array($thing) || $thing instanceof \SimpleXMLElement) {
|
||||
if (is_countable($thing) || $thing instanceof \SimpleXMLElement) {
|
||||
return \count($thing);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user