PhpParser\BuilderAbstract::normalizeDocComment PHP Method

normalizeDocComment() protected method

Normalizes a doc comment: Converts plain strings to PhpParser\Comment\Doc.
protected normalizeDocComment ( PhpParser\Comment\Doc | string $docComment ) : PhpParser\Comment\Doc
$docComment PhpParser\Comment\Doc | string The doc comment to normalize
return PhpParser\Comment\Doc The normalized doc comment
    protected function normalizeDocComment($docComment) {
        if ($docComment instanceof Comment\Doc) {
            return $docComment;
        } else if (is_string($docComment)) {
            return new Comment\Doc($docComment);
        } else {
            throw new \LogicException('Doc comment must be a string or an instance of PhpParser\Comment\Doc');
        }
    }