mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-11 09:56:32 +00:00
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