@@ -2108,13 +2108,12 @@ public function addEntityListener(string $eventName, string $class, string $meth
21082108 * @param DiscriminatorColumnMapping|mixed[]|null $columnDef
21092109 * @psalm-param DiscriminatorColumnMapping|array{
21102110 * name: string|null,
2111- * fieldName?: string,
2112- * type?: string,
2113- * length?: int,
2111+ * fieldName?: string|null ,
2112+ * type?: string|null ,
2113+ * length?: int|null ,
21142114 * columnDefinition?: string|null,
21152115 * enumType?: class-string<BackedEnum>|null,
2116- * options?:array<string,
2117- * mixed>|null
2116+ * options?: array<string, mixed>|null
21182117 * }|null $columnDef
21192118 *
21202119 * @throws MappingException
@@ -2136,13 +2135,9 @@ public function setDiscriminatorColumn(DiscriminatorColumnMapping|array|null $co
21362135 throw MappingException::duplicateColumnName ($ this ->name , $ columnDef ['name ' ]);
21372136 }
21382137
2139- if (! isset ($ columnDef ['fieldName ' ])) {
2140- $ columnDef ['fieldName ' ] = $ columnDef ['name ' ];
2141- }
2142-
2143- if (! isset ($ columnDef ['type ' ])) {
2144- $ columnDef ['type ' ] = 'string ' ;
2145- }
2138+ $ columnDef ['fieldName ' ] ??= $ columnDef ['name ' ];
2139+ $ columnDef ['type ' ] ??= 'string ' ;
2140+ $ columnDef ['options ' ] ??= [];
21462141
21472142 if (in_array ($ columnDef ['type ' ], ['boolean ' , 'array ' , 'object ' , 'datetime ' , 'time ' , 'date ' ], true )) {
21482143 throw MappingException::invalidDiscriminatorColumnType ($ this ->name , $ columnDef ['type ' ]);
0 commit comments