comparison vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php @ 0:4c8ae668cc8c

Initial import (non-working)
author Chris Cannam
date Wed, 29 Nov 2017 16:09:58 +0000
parents
children 5fb285c0d0e3
comparison
equal deleted inserted replaced
-1:000000000000 0:4c8ae668cc8c
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 }