CommentLexer
namespace |
bhenk\doc2rst\process |
predicates |
Cloneable | Instantiable |
implements |
|
extends |
|
hierarchy |
Reads and processes DocComments
According to PSR-5 Definitions a “DocComment” is a special type of comment which MUST
start with the character sequence /** followed by a whitespace character
end with */ and
have zero or more lines in between.
This CommentLexer reads summary lines up to the first period or the first white line is encountered. The rest of the PHPdoc comment is treated as description.
Inline tags are treated as such and rendered at their original location in the text. Inline tags begin with {@ and end with a }. Non-inline tags that are not at the start of a line, will not be rendered. (For instance @link http://whatever.com whatever.)
Tags at the start of a line are filtered out, rendered and appear in a predefined order and location in the documentation. @todo link to comment and tag order
Constructor
CommentLexer::__construct
predicates |
public | constructor |
Constructs a new CommentLexer
public function __construct(
Parameter #0 [ <required> string $docComment ]
Parameter #1 [ <optional> bool $ignoreInheritdoc = false ]
)
Methods
CommentLexer::getCommentOrganizer
predicates |
public |
public function getCommentOrganizer(): CommentOrganizer
CommentLexer::lex
predicates |
public |
public function lex(): void
CommentLexer::markupSummary
predicates |
public |
public function markupSummary(
Parameter #0 [ <required> array $processed ]
): array
CommentLexer::preserveMarkup
predicates |
public | static |
Preserve markup in an otherwise strong line
Example:
before: "Preserves italic *null* and ticks ``true`` markup"
after: "**Preserves italic** *null* **and ticks** ``true`` **markup**"
public static function preserveMarkup(
Parameter #0 [ <required> string $line ]
): string
CommentLexer::__toString
predicates |
public |
implements |
|
inherited from |
see also
public function __toString(): string
CommentLexer::getSegments
predicates |
public |
inherited from |
public function getSegments(): array
CommentLexer::setSegments
predicates |
public |
inherited from |
public function setSegments(
Parameter #0 [ <required> array $segments ]
): void
CommentLexer::addSegment
predicates |
public |
inherited from |
public function addSegment(
Parameter #0 [ <required> Stringable|string $segment ]
): void
CommentLexer::resolveReflectionType
predicates |
protected |
inherited from |
protected function resolveReflectionType(
Parameter #0 [ <required> ReflectionType $reflectionType ]
): string
CommentLexer::checkParameters
predicates |
protected |
inherited from |
protected function checkParameters(
Parameter #0 [ <required> bhenk\doc2rst\process\CommentLexer $lexer ]
Parameter #1 [ <required> array $params ]
): void
Fri, 31 Mar 2023 13:22:46 +0000