Skip to content

Commit

Permalink
Use is_iterable when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Oct 8, 2023
1 parent 2d37866 commit e4005e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Extension/CoreExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ function twig_call_macro(Template $template, string $method, array $args, int $l
*/
function twig_ensure_traversable($seq)
{
if ($seq instanceof \Traversable || \is_array($seq)) {
if (is_iterable($seq)) {
return $seq;
}

Expand Down Expand Up @@ -1296,7 +1296,7 @@ function twig_test_empty($value)
*/
function twig_test_iterable($value)
{
return $value instanceof \Traversable || \is_array($value);
return is_iterable($value);
}

/**
Expand Down

0 comments on commit e4005e3

Please sign in to comment.