Attribute Reader
This reader is used to read PHP attributes to construct metadata.
To create it, it is enough to instantiate AttributeReader class:
After this, you will have access to the description of the types in the PHP Attributes:
By default, it supports the following attributes:
#[DiscriminatorMap]- Allows to specify a discriminator map for a class or interface#[MapName]- Allows to specify public aliases for properties#[MapType]- Allows to specify property type and type strictness#[NormalizeAsArray]- Allows to specify class normalization rules (into an associative array or object)#[OnTypeError]- Allows to customize the type error in a property#[OnUndefinedError]- Allows to customize the "undefined property" error in a property#[SkipWhen]- Allows to specify an expression that will exclude a property during normalization#[SkipWhenEmpty]- Allows to specify a "when empty" rule that will exclude a property during normalization#[SkipWhenNull]- Allows to specify a "when null" rule that will exclude a property during normalization
If you need to supplement metadata from another reader, you should specify this explicitly using $delegate argument: