This contains a Symfony Denormalizer for the moneyphp/money
Money\Money
class.
Install with composer at krak/money-normalizer
.
$denormalizer = new Krak\MoneyNormalizer\MoneyDenormalizer();
$money = $denormalizer->denormalize(['amount' => 10, 'currency' => 'USD'], 'Money\Money');
Register the MoneyNormalizerBundle in your kernel in config/bundles.php
:
<?php
return [
//...
Krak\MoneyNormalizer\Bridge\Symfony\MoneyNormalizerBundle::class => ['all' => true],
];