Exemplo n.º 1
0
 public function endArrayNode(ArrayNode $node)
 {
     $nested = $this->nodeData[$node];
     unset($this->nodeData[$node]);
     if ($nested) {
         $this->indentLevel--;
     }
     $is_wrapped = $node->getElementList()->children(Filter::isNewline())->isNotEmpty();
     if ($is_wrapped) {
         // Enforce trailing comma after last element.
         $node->getElementList()->append(Token::comma());
         // Newline before closing ) or ].
         $this->newlineBefore($node->lastChild(), !$nested);
     }
 }