Skip to content

DocblockParser

Turns a raw docblock into a DocBlock.

A real parser rather than the line-stripping regexes the framework uses elsewhere, because a reference page needs the tags those throw away: @param and @return carry the narrow types (list<Route> where the signature only says array), and @throws is a section of its own.

final class DocblockParser

SourceDocblock/DocblockParser.php

public function __construct(): mixed

Returns mixed

MethodDescription
parse(?string $docComment): DocBlockParses a docblock, treating a missing or unparsable one as simply empty.

public function parse(?string $docComment): DocBlock

Parses a docblock, treating a missing or unparsable one as simply empty.

ParameterTypeDescription
$docComment?``string

Returns DocBlock