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