From a11fc85cb2392a1e0bab5d4ea9b52baa42368dc8 Mon Sep 17 00:00:00 2001 From: Jorick Pepin Date: Thu, 24 Oct 2024 20:34:27 +0200 Subject: [PATCH] fix: property name in error messages --- src/EventListener/MapFromListener.php | 2 +- src/EventListener/MapToListener.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/EventListener/MapFromListener.php b/src/EventListener/MapFromListener.php index 0ecf9f4..d26cdcb 100644 --- a/src/EventListener/MapFromListener.php +++ b/src/EventListener/MapFromListener.php @@ -39,7 +39,7 @@ public function __invoke(GenerateMapperEvent $event): void if ($reflectionClassOrPropertyOrMethod instanceof \ReflectionClass) { if ($mapFromAttributeInstance->property === null) { - throw new BadMapDefinitionException(sprintf('Required `name` property in the "%s" attribute on "%s" class.', MapFrom::class, $reflectionClassOrPropertyOrMethod->getName())); + throw new BadMapDefinitionException(sprintf('Required `property` property in the "%s" attribute on "%s" class.', MapFrom::class, $reflectionClassOrPropertyOrMethod->getName())); } if ($mapFromAttributeInstance->transformer === null) { diff --git a/src/EventListener/MapToListener.php b/src/EventListener/MapToListener.php index cb195e5..1d40857 100644 --- a/src/EventListener/MapToListener.php +++ b/src/EventListener/MapToListener.php @@ -38,7 +38,7 @@ public function __invoke(GenerateMapperEvent $event): void if ($reflectionClassOrPropertyOrMethod instanceof \ReflectionClass) { if ($mapToAttributeInstance->property === null) { - throw new BadMapDefinitionException(sprintf('Required `name` property in the "%s" attribute on "%s" class.', MapTo::class, $reflectionClassOrPropertyOrMethod->getName())); + throw new BadMapDefinitionException(sprintf('Required `property` property in the "%s" attribute on "%s" class.', MapTo::class, $reflectionClassOrPropertyOrMethod->getName())); } if ($mapToAttributeInstance->transformer === null) {