Closed
Description
Description
https://wiki.php.net/rfc/enumerations#backed_enums
Backed enums have scalar equivalents. The Serializer should be able to normalize and denormalize such enums.
Example
class Foo {
public Suit $suit;
}
$foo = new Foo();
$foo->suit = Suit::Diamonds;
$serialized = $this->serializer->serialize($foo, 'json')
// expected: '{ "suit": "D" }'
$this->serializer->deserialize($serialized, Foo::class);
// expected: Foo->suit === Suit::Diamonds
Should pure enums (no scalar equivalent) be supported as well, by relying on the name property? (Suit::Spades->name
)
Metadata
Metadata
Assignees
Labels
Issues and PRs which are looking for volunteers to complete them.Issues and PRs which are looking for volunteers to complete them.