30a1937f915109d9da30efe806f35bdb9a473b8d
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Builder / Declaration.php
1 <?php
2
3 namespace PhpParser\Builder;
4
5 use PhpParser;
6
7 abstract class Declaration extends PhpParser\BuilderAbstract
8 {
9     protected $attributes = array();
10
11     abstract public function addStmt($stmt);
12
13     /**
14      * Adds multiple statements.
15      *
16      * @param array $stmts The statements to add
17      *
18      * @return $this The builder instance (for fluid interface)
19      */
20     public function addStmts(array $stmts) {
21         foreach ($stmts as $stmt) {
22             $this->addStmt($stmt);
23         }
24
25         return $this;
26     }
27
28     /**
29      * Sets doc comment for the declaration.
30      *
31      * @param PhpParser\Comment\Doc|string $docComment Doc comment to set
32      *
33      * @return $this The builder instance (for fluid interface)
34      */
35     public function setDocComment($docComment) {
36         $this->attributes['comments'] = array(
37             $this->normalizeDocComment($docComment)
38         );
39
40         return $this;
41     }
42 }