3 namespace PhpParser\Builder;
7 abstract class Declaration extends PhpParser\BuilderAbstract
9 protected $attributes = array();
11 abstract public function addStmt($stmt);
14 * Adds multiple statements.
16 * @param array $stmts The statements to add
18 * @return $this The builder instance (for fluid interface)
20 public function addStmts(array $stmts) {
21 foreach ($stmts as $stmt) {
22 $this->addStmt($stmt);
29 * Sets doc comment for the declaration.
31 * @param PhpParser\Comment\Doc|string $docComment Doc comment to set
33 * @return $this The builder instance (for fluid interface)
35 public function setDocComment($docComment) {
36 $this->attributes['comments'] = array(
37 $this->normalizeDocComment($docComment)