You are here

public function Twig_Node_Expression_Array::addElement in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.3 vendor/Twig/Node/Expression/Array.php \Twig_Node_Expression_Array::addElement()

File

vendor/Twig/Node/Expression/Array.php, line 54

Class

Twig_Node_Expression_Array

Code

public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null) {
  if (null === $key) {
    $key = new Twig_Node_Expression_Constant(++$this->index, $value
      ->getLine());
  }
  array_push($this->nodes, $key, $value);
}