| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPDeveloper\BetterDocs\Dependencies\PhpParser\Builder; |
| 4 |
|
| 5 |
use WPDeveloper\BetterDocs\Dependencies\PhpParser; |
| 6 |
|
| 7 |
abstract class Declaration extends WPDeveloper\BetterDocs\Dependencies\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 WPDeveloper\BetterDocs\Dependencies\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 |
} |