@@ -2108,13 +2108,12 @@ public function addEntityListener(string $eventName, string $class, string $meth
2108
2108
* @param DiscriminatorColumnMapping|mixed[]|null $columnDef
2109
2109
* @psalm-param DiscriminatorColumnMapping|array{
2110
2110
* name: string|null,
2111
- * fieldName?: string,
2112
- * type?: string,
2113
- * length?: int,
2111
+ * fieldName?: string|null ,
2112
+ * type?: string|null ,
2113
+ * length?: int|null ,
2114
2114
* columnDefinition?: string|null,
2115
2115
* enumType?: class-string<BackedEnum>|null,
2116
- * options?:array<string,
2117
- * mixed>|null
2116
+ * options?: array<string, mixed>|null
2118
2117
* }|null $columnDef
2119
2118
*
2120
2119
* @throws MappingException
@@ -2136,13 +2135,9 @@ public function setDiscriminatorColumn(DiscriminatorColumnMapping|array|null $co
2136
2135
throw MappingException::duplicateColumnName ($ this ->name , $ columnDef ['name ' ]);
2137
2136
}
2138
2137
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 ' ] ??= [];
2146
2141
2147
2142
if (in_array ($ columnDef ['type ' ], ['boolean ' , 'array ' , 'object ' , 'datetime ' , 'time ' , 'date ' ], true )) {
2148
2143
throw MappingException::invalidDiscriminatorColumnType ($ this ->name , $ columnDef ['type ' ]);
0 commit comments