This contains a Symfony Denormalizer for the myclabs/php-enum
MyCLabs\Enum\Enum
class.
Install with composer at krak/enum-normalizer
.
$denormalizer = new Krak\EnumNormalizer\EnumDenormalizer();
$enum = $denormalizer->denormalize('value', AcmeEnum::class);
Register the EnumNormalizerBundle in your kernel in config/bundles.php
:
<?php
return [
//...
Krak\EnumNormalizer\Bridge\Symfony\EnumNormalizerBundle::class => ['all' => true],
];