public function Twig_Node_Expression_Array::addElement

File

drupal/core/vendor/twig/twig/lib/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);
}