Skip to content

Commit

Permalink
bug #2406 Fix tokenize call in DeprecationCollector (vdechenaux)
Browse files Browse the repository at this point in the history
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
-------

13ca97c Fix tokenize call in DeprecationCollector
  • Loading branch information
fabpot committed Feb 21, 2017
2 parents b6a16a2 + 13ca97c commit bb3f4d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Twig/Util/DeprecationCollector.php
Expand Up @@ -58,7 +58,7 @@ public function collect(Iterator $iterator)

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
}
Expand Down

0 comments on commit bb3f4d6

Please sign in to comment.