Skip to content

Commit

Permalink
fix: property name in error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
JorickPepin committed Oct 24, 2024
1 parent e959098 commit a11fc85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/EventListener/MapFromListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/EventListener/MapToListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a11fc85

Please sign in to comment.