Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 594 Bytes

README.md

File metadata and controls

29 lines (19 loc) · 594 Bytes

Money Normalizer

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],
];