Documentation

PhpDocExtractor
in package
implements PropertyDescriptionExtractorInterface, PropertyTypeExtractorInterface, ConstructorArgumentTypeExtractorInterface

Extracts data using a PHPDoc parser.

Tags
author

Kévin Dunglas dunglas@gmail.com

final

Table of Contents

Interfaces

PropertyDescriptionExtractorInterface
Guesses the property's human readable description.
PropertyTypeExtractorInterface
Type Extractor Interface.
ConstructorArgumentTypeExtractorInterface

Constants

ACCESSOR  = 1
MUTATOR  = 2
PROPERTY  = 0

Properties

$accessorPrefixes  : mixed
$arrayMutatorPrefixes  : mixed
$contextFactory  : mixed
$contexts  : array<string|int, Context>
$docBlockFactory  : mixed
$docBlocks  : array<string, DocBlock|null, : int|null, : string|null}>
$mutatorPrefixes  : mixed
$phpDocTypeHelper  : mixed

Methods

__construct()  : mixed
getLongDescription()  : string|null
Gets the long description of the property.
getShortDescription()  : string|null
Gets the short description of the property.
getTypes()  : array<string|int, Type>|null
Gets types of a property.
getTypesFromConstructor()  : array<string|int, mixed>|null
{@inheritdoc}
createFromReflector()  : Context
Prevents a lot of redundant calls to ContextFactory::createForNamespace().
filterDocBlockParams()  : DocBlock
getDocBlock()  : DocBlock|null, : int|null, : string|null}
getDocBlockFromConstructor()  : DocBlock|null
getDocBlockFromMethod()  : DocBlock, : string}|null
getDocBlockFromProperty()  : DocBlock|null

Constants

Properties

$docBlocks

private array<string, DocBlock|null, : int|null, : string|null}> $docBlocks = []

Methods

__construct()

public __construct([DocBlockFactoryInterface $docBlockFactory = null ][, array<string|int, string>|null $mutatorPrefixes = null ][, array<string|int, string>|null $accessorPrefixes = null ][, array<string|int, string>|null $arrayMutatorPrefixes = null ]) : mixed
Parameters
$docBlockFactory : DocBlockFactoryInterface = null
$mutatorPrefixes : array<string|int, string>|null = null
$accessorPrefixes : array<string|int, string>|null = null
$arrayMutatorPrefixes : array<string|int, string>|null = null

getLongDescription()

Gets the long description of the property.

public getLongDescription(string $class, string $property[, array<string|int, mixed> $context = [] ]) : string|null
Parameters
$class : string
$property : string
$context : array<string|int, mixed> = []
Return values
string|null

getShortDescription()

Gets the short description of the property.

public getShortDescription(string $class, string $property[, array<string|int, mixed> $context = [] ]) : string|null
Parameters
$class : string
$property : string
$context : array<string|int, mixed> = []
Return values
string|null

getTypes()

Gets types of a property.

public getTypes(string $class, string $property[, array<string|int, mixed> $context = [] ]) : array<string|int, Type>|null
Parameters
$class : string
$property : string
$context : array<string|int, mixed> = []
Return values
array<string|int, Type>|null

getTypesFromConstructor()

{@inheritdoc}

public getTypesFromConstructor(string $class, string $property) : array<string|int, mixed>|null
Parameters
$class : string
$property : string
Return values
array<string|int, mixed>|null

createFromReflector()

Prevents a lot of redundant calls to ContextFactory::createForNamespace().

private createFromReflector(ReflectionClass $reflector) : Context
Parameters
$reflector : ReflectionClass
Return values
Context

getDocBlock()

private getDocBlock(string $class, string $property) : DocBlock|null, : int|null, : string|null}
Parameters
$class : string
$property : string
Return values
DocBlock|null, : int|null, : string|null}

getDocBlockFromConstructor()

private getDocBlockFromConstructor(string $class, string $property) : DocBlock|null
Parameters
$class : string
$property : string
Return values
DocBlock|null

getDocBlockFromMethod()

private getDocBlockFromMethod(string $class, string $ucFirstProperty, int $type) : DocBlock, : string}|null
Parameters
$class : string
$ucFirstProperty : string
$type : int
Return values
DocBlock, : string}|null

getDocBlockFromProperty()

private getDocBlockFromProperty(string $class, string $property) : DocBlock|null
Parameters
$class : string
$property : string
Return values
DocBlock|null

        
On this page

Search results