bug #2406 Fix tokenize call in DeprecationCollector (vdechenaux)

This PR was submitted for the 2.x branch but it was merged into the 1.x branch instead (closes #2406).

Discussion
----------

Fix tokenize call in DeprecationCollector

Hi,

if fixes `Argument 1 passed to Twig_Environment::tokenize() must be an instance of Twig_Source, string given`

Commits
-------

13ca97c1 Fix tokenize call in DeprecationCollector
This commit is contained in:
Fabien Potencier
2017-02-21 07:46:47 -08:00
+1 -1
View File
@@ -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
}