krak / enum-normalizer
Symfony Normalizer/Denormalizer for myclabs/enum
Installs: 22 653
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- symfony/serializer: ^4.4|^5.4|^6.0
Requires (Dev)
- phpunit/phpunit: ^10
README
This contains a Symfony Denormalizer for the myclabs/php-enum
MyCLabs\Enum\Enum
class.
Installation
Install with composer at krak/enum-normalizer
.
Usage
EnumDenormalizer
$denormalizer = new Krak\EnumNormalizer\EnumDenormalizer(); $enum = $denormalizer->denormalize('value', AcmeEnum::class);
Symfony Integration
Register the EnumNormalizerBundle in your kernel in config/bundles.php
:
<?php return [ //... Krak\EnumNormalizer\Bridge\Symfony\EnumNormalizerBundle::class => ['all' => true], ];