# betterdocs/3.8.9/includes/Dependencies/PhpParser/Builder/Declaration.php

BetterDocs – AI Documentation, Knowledge Base, MCP Server, Docs, Wikis, FAQ &amp; Chatbot, version 3.8.9. 42 lines.

- Page: https://pluginprobe.com/plugins/betterdocs/3.8.9/code/includes/Dependencies/PhpParser/Builder/Declaration.php
- Raw: https://pluginprobe.com/plugins/betterdocs/3.8.9/raw/includes/Dependencies/PhpParser/Builder/Declaration.php
- Modified: 2023-08-14T08:41:14+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/betterdocs/3.8.9/code/includes/Dependencies/PhpParser/Builder/Declaration.php#L10-L20`.

```php
<?php

namespace WPDeveloper\BetterDocs\Dependencies\PhpParser\Builder;

use WPDeveloper\BetterDocs\Dependencies\PhpParser;

abstract class Declaration extends WPDeveloper\BetterDocs\Dependencies\PhpParser\BuilderAbstract
{
    protected $attributes = array();

    abstract public function addStmt($stmt);

    /**
     * Adds multiple statements.
     *
     * @param array $stmts The statements to add
     *
     * @return $this The builder instance (for fluid interface)
     */
    public function addStmts(array $stmts) {
        foreach ($stmts as $stmt) {
            $this->addStmt($stmt);
        }

        return $this;
    }

    /**
     * Sets doc comment for the declaration.
     *
     * @param WPDeveloper\BetterDocs\Dependencies\PhpParser\Comment\Doc|string $docComment Doc comment to set
     *
     * @return $this The builder instance (for fluid interface)
     */
    public function setDocComment($docComment) {
        $this->attributes['comments'] = array(
            $this->normalizeDocComment($docComment)
        );

        return $this;
    }
}
```
