From 8159356366f5686a5c7b1206404a38610ddcf3c1 Mon Sep 17 00:00:00 2001 From: Jorick Pepin Date: Wed, 16 Oct 2024 18:12:46 +0200 Subject: [PATCH] fix: signature of Map attributes `transformer` property --- src/Attribute/MapFrom.php | 16 ++++++++-------- src/Attribute/MapTo.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Attribute/MapFrom.php b/src/Attribute/MapFrom.php index 2bc9d32..092ccc7 100644 --- a/src/Attribute/MapFrom.php +++ b/src/Attribute/MapFrom.php @@ -11,14 +11,14 @@ final readonly class MapFrom { /** - * @param class-string|'array'|array|'array'>|null $source The specific source class name or array. If null this attribute will be used for all source classes. - * @param string|null $property The source property name. If null, the target property name will be used. - * @param int|null $maxDepth The maximum depth of the mapping. If null, the default max depth will be used. - * @param string|callable(mixed $value, object $object): mixed|null $transformer A transformer id or a callable that transform the value during mapping - * @param bool|null $ignore If true, the property will be ignored during mapping - * @param string|null $if The condition to map the property, using the expression language - * @param string[]|null $groups The groups to map the property - * @param string|null $dateTimeFormat The date-time format to use when transforming this property + * @param class-string|'array'|array|'array'>|null $source The specific source class name or array. If null this attribute will be used for all source classes. + * @param string|null $property The source property name. If null, the target property name will be used. + * @param int|null $maxDepth The maximum depth of the mapping. If null, the default max depth will be used. + * @param string|callable(mixed $value, object|array $source, array $context): mixed $transformer A transformer id or a callable that transform the value during mapping + * @param bool|null $ignore If true, the property will be ignored during mapping + * @param string|null $if The condition to map the property, using the expression language + * @param string[]|null $groups The groups to map the property + * @param string|null $dateTimeFormat The date-time format to use when transforming this property */ public function __construct( public string|array|null $source = null, diff --git a/src/Attribute/MapTo.php b/src/Attribute/MapTo.php index acac968..29af493 100644 --- a/src/Attribute/MapTo.php +++ b/src/Attribute/MapTo.php @@ -11,14 +11,14 @@ final readonly class MapTo { /** - * @param class-string|'array'|array|'array'>|null $target The specific target class name or array. If null this attribute will be used for all target classes. - * @param string|null $property The target property name. If null, the source property name will be used. - * @param int|null $maxDepth The maximum depth of the mapping. If null, the default max depth will be used. - * @param string|callable(mixed $value, object $object): mixed|null $transformer A transformer id or a callable that transform the value during mapping - * @param bool|null $ignore If true, the property will be ignored during mapping - * @param string|null $if The condition to map the property, using the expression language - * @param string[]|null $groups The groups to map the property - * @param string|null $dateTimeFormat The date-time format to use when transforming this property + * @param class-string|'array'|array|'array'>|null $target The specific target class name or array. If null this attribute will be used for all target classes. + * @param string|null $property The target property name. If null, the source property name will be used. + * @param int|null $maxDepth The maximum depth of the mapping. If null, the default max depth will be used. + * @param string|callable(mixed $value, object|array $source, array $context): mixed $transformer A transformer id or a callable that transform the value during mapping + * @param bool|null $ignore If true, the property will be ignored during mapping + * @param string|null $if The condition to map the property, using the expression language + * @param string[]|null $groups The groups to map the property + * @param string|null $dateTimeFormat The date-time format to use when transforming this property */ public function __construct( public string|array|null $target = null,