public function appendStatement(StatementNode $statementNode) {
    if (!$this->isEmpty() && $this->firstToken()->getType() === '{') {
      $this->lastChild()->before($statementNode);
    }
    else {
      $this->appendChild($statementNode);
    }
    return $this;
  }
public function appendStatement(StatementNode $statementNode) {
    if (!$this->isEmpty() && $this->firstToken()->getType() === '{') {
      $this->lastChild()->before($statementNode);
    }
    else {
      $this->appendChild($statementNode);
    }
    return $this;
  }
public function appendStatement ( StatementNode $ statementNode ) { if ( ! $ this -> isEmpty ( ) && $ this -> firstToken ( ) -> getType ( ) === '{' ) { $ this -> lastChild ( ) -> before ( $ statementNode ) ; } else { $ this -> appendChild ( $ statementNode ) ; } return $ this ; }
Append statement to block.

@param StatementNode $statementNode
Statement to append.
@return $this
Append statement to block .