Skip to content

Commit

Permalink
fix: property name in error messages (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
Korbeil authored Oct 24, 2024
2 parents e959098 + a11fc85 commit 0dbc341
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 0dbc341

Please sign in to comment.