Serde
Serde copied to clipboard
Robust Serde (serialization/deserialization) library for PHP 8.
## Detailed description Currently, Serde tries to use the default value from a matching-name constructor parameter as a default for a property. That's fine if it's a promoted property. If...
According to the documentation, "any PostLoad methods will be invoked with no arguments in lexical order." This is not true: ````php class MyClass { private string $prop1; private string $prop2;...
## Problem: Multi-level object arrays I'm running into another limit with a 2-level array like this: ``` class Ledger { /** * @param InfoObject[][] $info, */ public function __contruct( private...
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,...
Thanks a lot, this library is so much fun! When playing with it, i found this though: This one breaks, in the sense that it does NOT add a type...
If a child class has the same property name but different type as a parent class, serde serializes but fails to deserialize. See this example: ```php
## Description This contains and merges with https://github.com/Crell/Serde/pull/84. This adds the formatter for protobuf and provides serialization for all the different types introduced in #84. Each type has slightly different...
## Description To support something like protobuf, Serde requires more type tags than PHP currently has support for. This adds multiple new type tags that currently do nothing: - Binary:...
We already have a custom `EnumOnArrayImporter`. We ought to have one for DateTime, too. Which is an ugly way to do it, but c'est la vie.