Documentation

PropertyInfoExtractor
in package
implements PropertyInfoExtractorInterface, PropertyInitializableExtractorInterface

Default {@see PropertyInfoExtractorInterface} implementation.

Tags
author

Kévin Dunglas dunglas@gmail.com

final

Table of Contents

Interfaces

PropertyInfoExtractorInterface
Gets info about PHP class properties.
PropertyInitializableExtractorInterface
Guesses if the property can be initialized through the constructor.

Properties

$accessExtractors  : iterable<string|int, mixed>
$descriptionExtractors  : iterable<string|int, mixed>
$initializableExtractors  : iterable<string|int, mixed>
$listExtractors  : iterable<string|int, mixed>
$typeExtractors  : iterable<string|int, mixed>

Methods

__construct()  : mixed
getLongDescription()  : string|null
Gets the long description of the property.
getProperties()  : array<string|int, string>|null
Gets the list of properties available for the given class.
getShortDescription()  : string|null
Gets the short description of the property.
getType()  : Type|null
getTypes()  : array<string|int, Type>|null
Gets types of a property.
isInitializable()  : bool|null
Is the property initializable? Returns true if a constructor's parameter matches the given property name.
isReadable()  : bool|null
Is the property readable?
isWritable()  : bool|null
Is the property writable?
extract()  : mixed
Iterates over registered extractors and return the first value found.

Properties

$descriptionExtractors read-only

private iterable<string|int, mixed> $descriptionExtractors = []

$initializableExtractors read-only

private iterable<string|int, mixed> $initializableExtractors = []

Methods

__construct()

public __construct([iterable<mixed, PropertyListExtractorInterface$listExtractors = [] ][, iterable<mixed, PropertyTypeExtractorInterface$typeExtractors = [] ][, iterable<mixed, PropertyDescriptionExtractorInterface$descriptionExtractors = [] ][, iterable<mixed, PropertyAccessExtractorInterface$accessExtractors = [] ][, iterable<mixed, PropertyInitializableExtractorInterface$initializableExtractors = [] ]) : mixed
Parameters
$listExtractors : iterable<mixed, PropertyListExtractorInterface> = []
$typeExtractors : iterable<mixed, PropertyTypeExtractorInterface> = []
$descriptionExtractors : iterable<mixed, PropertyDescriptionExtractorInterface> = []
$accessExtractors : iterable<mixed, PropertyAccessExtractorInterface> = []
$initializableExtractors : iterable<mixed, PropertyInitializableExtractorInterface> = []

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

getProperties()

Gets the list of properties available for the given class.

public getProperties(string $class[, array<string|int, mixed> $context = [] ]) : array<string|int, string>|null
Parameters
$class : string
$context : array<string|int, mixed> = []
Return values
array<string|int, 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

getType()

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

getTypes()

Gets types of a property.

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

since Symfony 7.3, use "getType" instead

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

isInitializable()

Is the property initializable? Returns true if a constructor's parameter matches the given property name.

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

isReadable()

Is the property readable?

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

isWritable()

Is the property writable?

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

extract()

Iterates over registered extractors and return the first value found.

private extract(iterable<mixed, object> $extractors, string $method, array<int, mixed> $arguments) : mixed
Parameters
$extractors : iterable<mixed, object>
$method : string
$arguments : array<int, mixed>

        
On this page

Search results