annotate vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 5fb285c0d0e3
children
rev   line source
Chris@13 1 <?php declare(strict_types=1);
Chris@0 2
Chris@0 3 namespace PhpParser\Builder;
Chris@0 4
Chris@0 5 use PhpParser;
Chris@13 6 use PhpParser\BuilderHelpers;
Chris@0 7
Chris@13 8 abstract class Declaration implements PhpParser\Builder
Chris@0 9 {
Chris@13 10 protected $attributes = [];
Chris@0 11
Chris@0 12 abstract public function addStmt($stmt);
Chris@0 13
Chris@0 14 /**
Chris@0 15 * Adds multiple statements.
Chris@0 16 *
Chris@0 17 * @param array $stmts The statements to add
Chris@0 18 *
Chris@0 19 * @return $this The builder instance (for fluid interface)
Chris@0 20 */
Chris@0 21 public function addStmts(array $stmts) {
Chris@0 22 foreach ($stmts as $stmt) {
Chris@0 23 $this->addStmt($stmt);
Chris@0 24 }
Chris@0 25
Chris@0 26 return $this;
Chris@0 27 }
Chris@0 28
Chris@0 29 /**
Chris@0 30 * Sets doc comment for the declaration.
Chris@0 31 *
Chris@0 32 * @param PhpParser\Comment\Doc|string $docComment Doc comment to set
Chris@0 33 *
Chris@0 34 * @return $this The builder instance (for fluid interface)
Chris@0 35 */
Chris@0 36 public function setDocComment($docComment) {
Chris@13 37 $this->attributes['comments'] = [
Chris@13 38 BuilderHelpers::normalizeDocComment($docComment)
Chris@13 39 ];
Chris@0 40
Chris@0 41 return $this;
Chris@0 42 }
Chris@13 43 }