unapi / helper-money
There is no license information available for the latest version (1.3.2) of this package.
Unapi helper: money
1.3.2
2025-12-22 16:14 UTC
Requires
- php: >=7.1.0
- unapi/helper-types: ^1.0
Requires (Dev)
- phpunit/phpunit: ^11.5
README
PHP implementation for the MoneyAmount pattern.
Installation
With composer:
composer require unapi/helper-money
Usage
Create Money amount:
use unapi\helper\money\MoneyAmount; use unapi\helper\money\Currency; $money = new MoneyAmount(20.0, new Currency(Currency::EUR));
Create wallet:
use unapi\helper\money\Wallet; use unapi\helper\money\MoneyAmount; use unapi\helper\money\Currency; $wallet = new Wallet([ new MoneyAmount(20.0, new Currency(Currency::EUR)) new MoneyAmount(10.0, new Currency(Currency::USD)) ]); $wallet->addMoney( new MoneyAmount(5.0, new Currency(Currency::EUR)) );