mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-14 03:16:34 +00:00
feature #3788 Add Compile::reset() (fabpot)
This PR was merged into the 3.x branch.
Discussion
----------
Add Compile::reset()
refs #3736
Commits
-------
824dbd9e Add Compile::reset()
This commit is contained in:
+10
-1
@@ -46,7 +46,7 @@ class Compiler
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function compile(Node $node, int $indentation = 0)
|
||||
public function reset(int $indentation = 0)
|
||||
{
|
||||
$this->lastLine = null;
|
||||
$this->source = '';
|
||||
@@ -57,6 +57,15 @@ class Compiler
|
||||
$this->indentation = $indentation;
|
||||
$this->varNameSalt = 0;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return $this
|
||||
*/
|
||||
public function compile(Node $node, int $indentation = 0)
|
||||
{
|
||||
$this->reset($indentation);
|
||||
$node->compile($this);
|
||||
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user