Serde
Serde copied to clipboard
Enum and StaticTypeMap breaks
Got exception:
Error: Cannot instantiate enum FooAccountEnum in ReflectionClass->newInstanceWithoutConstructor() (line 168 of vendor/crell/serde/src/PropertyHandler/ObjectImporter.php).
from sth like this:
public function __construct(
#[StaticTypeMap(key: 'type', map: [
'foo' => FooAccountEnum::class,
'bar' => BarAccountEnum::class,
])]
public readonly AccountInterface $account,
) {}