1: | <?php declare(strict_types=1); |
2: | |
3: | namespace PhpParser\Builder; |
4: | |
5: | use PhpParser; |
6: | use PhpParser\BuilderHelpers; |
7: | |
8: | abstract class Declaration implements PhpParser\Builder |
9: | { |
10: | protected $attributes = []; |
11: | |
12: | abstract public function addStmt($stmt); |
13: | |
14: | |
15: | |
16: | |
17: | |
18: | |
19: | |
20: | |
21: | public function addStmts(array $stmts) { |
22: | foreach ($stmts as $stmt) { |
23: | $this->addStmt($stmt); |
24: | } |
25: | |
26: | return $this; |
27: | } |
28: | |
29: | |
30: | |
31: | |
32: | |
33: | |
34: | |
35: | |
36: | public function setDocComment($docComment) { |
37: | $this->attributes['comments'] = [ |
38: | BuilderHelpers::normalizeDocComment($docComment) |
39: | ]; |
40: | |
41: | return $this; |
42: | } |
43: | } |
44: | |