PHPackages                             mgamadeus/ddd-common-money - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mgamadeus/ddd-common-money

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mgamadeus/ddd-common-money
==========================

Currency and MoneyAmount value objects for mgamadeus/ddd

1.1.0(1w ago)0137↓50%2MITPHP

Since Apr 15Pushed 1w agoCompare

[ Source](https://github.com/mgamadeus/ddd-money)[ Packagist](https://packagist.org/packages/mgamadeus/ddd-common-money)[ RSS](/packages/mgamadeus-ddd-common-money/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (2)Versions (5)Used By (2)

mgamadeus/ddd-common-money
==========================

[](#mgamadeusddd-common-money)

Currency and MoneyAmount value objects for the [mgamadeus/ddd](https://github.com/mgamadeus/ddd) framework.

Installation
------------

[](#installation)

```
composer require mgamadeus/ddd-common-money
```

What It Does
------------

[](#what-it-does)

Lightweight value objects for handling monetary amounts with currency awareness:

- **Currency** -- ISO 4217 currency codes (27 supported) with symbol and display formatting
- **MoneyAmount** -- Amount + Currency composition with value equality comparison

Both are ValueObjects -- stored as JSON when used as entity properties.

Usage
-----

[](#usage)

```
use DDD\Domain\Common\Entities\Money\Currency;
use DDD\Domain\Common\Entities\Money\MoneyAmount;

// Create a monetary amount
$price = new MoneyAmount(29.99, 'EUR');
$price = new MoneyAmount(0.0, Currency::byIsoCode('USD'));

// Use as entity property (stored as JSON)
class Product extends Entity
{
    public ?MoneyAmount $price = null;
}

// Compare (checks both amount AND currency)
$a = new MoneyAmount(10.0, 'EUR');
$b = new MoneyAmount(10.0, 'USD');
$a->isEqualTo($b);  // false -- different currency
```

Supported Currencies
--------------------

[](#supported-currencies)

ARS, AUD, BRL, CAD, CHF, CLP, COP, CZK, **EUR** (default), GBP, HUF, IDR, INR, JPY, MXN, MYR, NOK, PEN, PHP, PLN, RUB, SEK, SGD, USD, VEF, ZAR

Invalid ISO codes fall back to EUR.

Overriding
----------

[](#overriding)

```
namespace App\Domain\Common\Entities\Money;

use DDD\Domain\Common\Entities\Money\Currency as BaseCurrency;

class Currency extends BaseCurrency
{
    // Add custom currencies or symbols
}
```

License
-------

[](#license)

MIT

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance98

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~14 days

Total

4

Last Release

12d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2896811?v=4)[mgamadeus](/maintainers/mgamadeus)[@mgamadeus](https://github.com/mgamadeus)

---

Top Contributors

[![mgamadeus](https://avatars.githubusercontent.com/u/2896811?v=4)](https://github.com/mgamadeus "mgamadeus (5 commits)")

### Embed Badge

![Health badge](/badges/mgamadeus-ddd-common-money/health.svg)

```
[![Health](https://phpackages.com/badges/mgamadeus-ddd-common-money/health.svg)](https://phpackages.com/packages/mgamadeus-ddd-common-money)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
