diff --git a/lib/Twig/Util/DeprecationCollector.php b/lib/Twig/Util/DeprecationCollector.php index 1e517f5c0..f8e1adba5 100644 --- a/lib/Twig/Util/DeprecationCollector.php +++ b/lib/Twig/Util/DeprecationCollector.php @@ -58,7 +58,7 @@ class Twig_Util_DeprecationCollector foreach ($iterator as $name => $contents) { try { - $this->twig->parse($this->twig->tokenize($contents, $name)); + $this->twig->parse($this->twig->tokenize(new Twig_Source($contents, $name))); } catch (Twig_Error_Syntax $e) { // ignore templates containing syntax errors }