A collection of normalizers that can be used with the Symfony serializer.
You can install the package via composer:
composer require morrislaptop/symfony-custom-normalizers
- Any class with a
__toString()
method - Any class with a
parse($str)
method - Any class with a
__toString()
if it has aparse($str)
method as well - ObjectDocblocksNormalizer which simply extends Symfony's ObjectNormalizer but it supports docblocks as well
$serializer = new Symfony\Serializer([
new Morrislaptop\SymfonyCustomNormalizers\MoneyNormalizer(),
new Morrislaptop\SymfonyCustomNormalizers\DatePeriodNormalizer(),
...
])
Use Laravel? Easily cast your objects using the Symfony serializer with morrislaptop/laravel-popo-caster
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.