mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 18:36:53 +00:00
Merge branch '1.x' into 2.x
* 1.x: fixed CS
This commit is contained in:
@@ -652,7 +652,7 @@ function twig_slice(Environment $env, $item, $start, $length = null, $preserveKe
|
||||
if ($start >= 0 && $length >= 0 && $item instanceof \Iterator) {
|
||||
try {
|
||||
return iterator_to_array(new \LimitIterator($item, $start, null === $length ? -1 : $length), $preserveKeys);
|
||||
} catch (\OutOfBoundsException $exception) {
|
||||
} catch (\OutOfBoundsException $e) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user