Skip to content

morrislaptop/symfony-custom-normalizers

Repository files navigation

Normalizers for common classes around the place

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A collection of normalizers that can be used with the Symfony serializer.

Installation

You can install the package via composer:

composer require morrislaptop/symfony-custom-normalizers

Supported Classes

Meta Classes

  • Any class with a __toString() method
  • Any class with a parse($str) method
  • Any class with a __toString() if it has a parse($str) method as well
  • ObjectDocblocksNormalizer which simply extends Symfony's ObjectNormalizer but it supports docblocks as well

Usage

$serializer = new Symfony\Serializer([
    new Morrislaptop\SymfonyCustomNormalizers\MoneyNormalizer(),
    new Morrislaptop\SymfonyCustomNormalizers\DatePeriodNormalizer(),
    ...
])

Plug

Use Laravel? Easily cast your objects using the Symfony serializer with morrislaptop/laravel-popo-caster

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Normalizers for common classes around the place

Resources

License

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages