krak / money-normalizer
Symfony Normalizer/Denormalizer for moneyphp/money
Installs: 19 612
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- symfony/serializer: ^3.4|^4.1|^5.4|^6.3
Requires (Dev)
- symfony/dependency-injection: ^5.4
- symfony/http-kernel: ^5.4
README
This contains a Symfony Denormalizer for the moneyphp/money
Money\Money
class.
Installation
Install with composer at krak/money-normalizer
.
Usage
MoneyDenormalizer
$denormalizer = new Krak\MoneyNormalizer\MoneyDenormalizer(); $money = $denormalizer->denormalize(['amount' => 10, 'currency' => 'USD'], 'Money\Money');
Symfony Integration
Register the MoneyNormalizerBundle in your kernel in config/bundles.php
:
<?php return [ //... Krak\MoneyNormalizer\Bridge\Symfony\MoneyNormalizerBundle::class => ['all' => true], ];