Skip to content

Commit

Permalink
fix(metadata): property override when value is set (api-platform#4767)
Browse files Browse the repository at this point in the history
  • Loading branch information
soyuka committed Jun 29, 2022
1 parent cee59c7 commit c8d1f44
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function create(string $resourceClass, string $property, array $options =

$wither = str_replace(['get', 'is'], 'with', $method);

if (method_exists($propertyMetadata, $wither) && null !== $legacyPropertyMetadata->{$method}()) {
if (method_exists($propertyMetadata, $wither) && null !== $legacyPropertyMetadata->{$method}() && null === $propertyMetadata->{$method}()) {
$propertyMetadata = $propertyMetadata->{$wither}($legacyPropertyMetadata->{$method}());
}
}
Expand Down

0 comments on commit c8d1f44

Please sign in to comment.