You are here

public function Twig_Compiler::outdent in Translation template extractor 7.3

Same name and namespace in other branches
  1. 6.3 vendor/Twig/Compiler.php \Twig_Compiler::outdent()

Outdents the generated code.

Parameters

int $step The number of indentation to remove:

Return value

Twig_Compiler The current compiler instance

Throws

LogicException When trying to outdent too much so the indentation would become negative

File

vendor/Twig/Compiler.php, line 261

Class

Twig_Compiler
Compiles a node to PHP code.

Code

public function outdent($step = 1) {

  // can't outdent by more steps than the current indentation level
  if ($this->indentation < $step) {
    throw new LogicException('Unable to call outdent() as the indentation would become negative');
  }
  $this->indentation -= $step;
  return $this;
}