Mercurial > hg > isophonics-drupal-site
annotate vendor/nikic/php-parser/lib/PhpParser/Builder/Declaration.php @ 13:5fb285c0d0e3
Update Drupal core to 8.4.7 via Composer. Security update; I *think* we've
been lucky to get away with this so far, as we don't support self-registration
which seems to be used by the so-called "drupalgeddon 2" attack that 8.4.5
was vulnerable to.
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:33:26 +0100 |
parents | 4c8ae668cc8c |
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 } |