interface PhpDocParserInterface (View source)

Interface for PhpDoc parsers.

Allows switching between different PhpDoc parsing implementations (e.g., phpDocumentor, PHPStan, custom parsers).

Methods

parseDocComment(string|null $docComment)

Parse a PhpDoc comment string and extract all relevant information.

parseElementPhpDoc(DocCommentNode|null $docComment)

Parse a PhpDoc comment from a DocCommentNode and merge with attribute information.

Details

ParsedPhpDoc parseDocComment(string|null $docComment)

Parse a PhpDoc comment string and extract all relevant information.

Parameters

string|null $docComment

The PhpDoc comment text (including /* \/)

Return Value

ParsedPhpDoc

Parsed PhpDoc data, or empty object if parsing fails

ParsedPhpDoc parseElementPhpDoc(DocCommentNode|null $docComment)

Parse a PhpDoc comment from a DocCommentNode and merge with attribute information.

This method handles both PhpDoc tags and PhpStormStubsElementAvailable attributes, with attributes taking precedence over PhpDoc tags.

Parameters

DocCommentNode|null $docComment

The doc comment node from AST

Return Value

ParsedPhpDoc

Parsed and merged PhpDoc data