Skip to content

Commit

Permalink
Add support for null
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Feb 6, 2024
1 parent ef24c95 commit d4606f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Mapping/DiscriminatorColumnMapping.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
* length?: int|null,
* columnDefinition?: string|null,
* enumType?: class-string<BackedEnum>|null,
* options?: array<string, mixed>,
* options?: array<string, mixed>|null,
* } $mappingArray
*/
public static function fromMappingArray(array $mappingArray): self
Expand All @@ -58,7 +58,7 @@ public static function fromMappingArray(array $mappingArray): self
}

if (property_exists($mapping, $key)) {
$mapping->$key = $value;
$mapping->$key = $value ?? $mapping->$key;
} else {
throw new Exception('Unknown property ' . $key . ' on class ' . static::class);
}
Expand Down

0 comments on commit d4606f1

Please sign in to comment.