PhpDocExtractor
in package
implements
PropertyDescriptionExtractorInterface, PropertyTypeExtractorInterface, ConstructorArgumentTypeExtractorInterface
Extracts data using a PHPDoc parser.
Tags
Table of Contents
Interfaces
- PropertyDescriptionExtractorInterface
- Guesses the property's human readable description.
- PropertyTypeExtractorInterface
- Type Extractor Interface.
- ConstructorArgumentTypeExtractorInterface
Constants
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
ACCESSOR
public
mixed
ACCESSOR
= 1
MUTATOR
public
mixed
MUTATOR
= 2
PROPERTY
public
mixed
PROPERTY
= 0
Properties
$accessorPrefixes
private
mixed
$accessorPrefixes
$arrayMutatorPrefixes
private
mixed
$arrayMutatorPrefixes
$contextFactory
private
mixed
$contextFactory
$contexts
private
array<string|int, Context>
$contexts
= []
$docBlockFactory
private
mixed
$docBlockFactory
$docBlocks
private
array<string, DocBlock|null, : int|null, : string|null}>
$docBlocks
= []
$mutatorPrefixes
private
mixed
$mutatorPrefixes
$phpDocTypeHelper
private
mixed
$phpDocTypeHelper
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|nullgetShortDescription()
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|nullgetTypes()
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>|nullgetTypesFromConstructor()
{@inheritdoc}
public
getTypesFromConstructor(string $class, string $property) : array<string|int, mixed>|null
Parameters
- $class : string
- $property : string
Return values
array<string|int, mixed>|nullcreateFromReflector()
Prevents a lot of redundant calls to ContextFactory::createForNamespace().
private
createFromReflector(ReflectionClass $reflector) : Context
Parameters
- $reflector : ReflectionClass
Return values
ContextfilterDocBlockParams()
private
filterDocBlockParams(DocBlock $docBlock, string $allowedParam) : DocBlock
Parameters
- $docBlock : DocBlock
- $allowedParam : string
Return values
DocBlockgetDocBlock()
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|nullgetDocBlockFromMethod()
private
getDocBlockFromMethod(string $class, string $ucFirstProperty, int $type) : DocBlock, : string}|null
Parameters
- $class : string
- $ucFirstProperty : string
- $type : int
Return values
DocBlock, : string}|nullgetDocBlockFromProperty()
private
getDocBlockFromProperty(string $class, string $property) : DocBlock|null
Parameters
- $class : string
- $property : string