$ show moneyphp/money
This is a mature PHP library implementing Martin Fowler's Money pattern as a value object. It provides a `Money` class that stores amounts as numeric strings in the smallest currency unit (e.g., cents), ensuring precision and avoiding floating-point errors. The library includes a rich set of features: arithmetic operations (add, subtract, multiply, divide, mod), comparison, allocation (by ratios or to N targets), aggregation (min, max, avg, sum), formatting (decimal, Intl, Bitcoin), parsing (decimal, Intl, Bitcoin), currency conversion via exchange rate providers (FixedExchange, Swap, Exchanger, IndirectExchange), and a `Teller` facade for migrating legacy float-based code. It supports multiple currency repositories (ISO 4217, Bitcoin, crypto-currencies from Binance) and offers pluggable calculators (BCMath required, GMP optional). The architecture is interface-driven with clean separation of concerns, extensive test coverage, and static analysis integration. It is not a data research project; it is a pure application library for monetary value handling.
The LLM identified 1 files worth highlighting for reuse:
A self-contained numeric value object that parses and manipulates numeric strings with high precision. It handles integer and fractional parts, base-10 scaling, rounding logic (half, even/odd, etc.), and validates input rigorously (rejects leading zeros, invalid characters). It is used internally by calculators and formatters but could be extracted as a standalone utility for any PHP project needing safe numeric string operations. Demonstrates careful edge-case handling and performance optimizations (e.g., happy-path integer checks).