unapi/helper-money

There is no license information available for the latest version (1.2.0) of this package.

Unapi helper: money

Installs: 4 547

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/unapi/helper-money

1.2.0 2025-11-15 20:56 UTC

This package is auto-updated.

Last update: 2025-11-15 20:58:23 UTC


README

Build Status Latest Stable Version Coverage Status PHP Version Require

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))
]);
$newWallet = $wallet->addMoney(
    new MoneyAmount(5.0, new Currency(Currency::EUR))
);