DocBlockFactory
in package
implements
DocBlockFactoryInterface
Interfaces, Classes and Traits
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
$descriptionFactory
private
DescriptionFactory
$descriptionFactory
$tagFactory
private
TagFactory
$tagFactory
Methods
__construct()
Initializes this factory with the required subcontractors.
public
__construct(DescriptionFactory $descriptionFactory, TagFactory $tagFactory) : mixed
Parameters
- $descriptionFactory : DescriptionFactory
- $tagFactory : TagFactory
Return values
mixed —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
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.