Documentation

DocBlockFactory
in package
implements DocBlockFactoryInterface

Interfaces, Classes, Traits and Enums

DocBlockFactoryInterface

Table of Contents

$descriptionFactory  : DescriptionFactory
$tagFactory  : TagFactory
__construct()  : mixed
Initializes this factory with the required subcontractors.
create()  : DocBlock
createInstance()  : self
Factory method for easy instantiation.
registerTagHandler()  : void
filterTagBlock()  : string|null
parseTagBlock()  : array<string|int, Tag>
Creates the tag objects.
splitDocBlock()  : array<string|int, string>
Splits the DocBlock into a template marker, summary, description and block of tags.
splitTagBlockIntoTagLines()  : array<string|int, string>
stripDocComment()  : string
Strips the asterisks from the DocBlock comment.

Properties

Methods

create()

public create(object|string $docblock[, Context|null $context = null ][, Location|null $location = null ]) : DocBlock
Parameters
$docblock : object|string

A string containing the DocBlock to parse or an object supporting the getDocComment method (such as a ReflectionClass object).

$context : Context|null = null
$location : Location|null = null
Return values
DocBlock

createInstance()

Factory method for easy instantiation.

public static createInstance([array<string, class-string<\phpDocumentor\Reflection\DocBlock\Tag>> $additionalTags = [] ]) : self
Parameters
$additionalTags : array<string, class-string<\phpDocumentor\Reflection\DocBlock\Tag>> = []
Return values
self

registerTagHandler()

public registerTagHandler(string $tagName, class-string<\phpDocumentor\Reflection\DocBlock\Tag> $handler) : void
Parameters
$tagName : string
$handler : class-string<\phpDocumentor\Reflection\DocBlock\Tag>
Return values
void

filterTagBlock()

private filterTagBlock(string $tags) : string|null
Parameters
$tags : string
Return values
string|null

parseTagBlock()

Creates the tag objects.

private parseTagBlock(string $tags, Context $context) : array<string|int, Tag>
Parameters
$tags : string

Tag block to parse.

$context : Context

Context of the parsed Tag

Return values
array<string|int, Tag>

splitDocBlock()

Splits the DocBlock into a template marker, summary, description and block of tags.

private splitDocBlock(string $comment) : array<string|int, string>
Parameters
$comment : string

Comment to split into the sub-parts.

Tags
author

Mike van Riel me@mikevanriel.com for extending the regex with template marker support.

author

Richard van Velzen (@_richardJ) Special thanks to Richard for the regex responsible for the split.

Return values
array<string|int, string>

containing the template marker (if any), summary, description and a string containing the tags.

splitTagBlockIntoTagLines()

private splitTagBlockIntoTagLines(string $tags) : array<string|int, string>
Parameters
$tags : string
Return values
array<string|int, string>

stripDocComment()

Strips the asterisks from the DocBlock comment.

private stripDocComment(string $comment) : string
Parameters
$comment : string

String containing the comment text.

Return values
string

Search results