{"id":13545563,"url":"https://github.com/moneyphp/money","last_synced_at":"2025-12-15T05:40:43.945Z","repository":{"id":37458431,"uuid":"1543827","full_name":"moneyphp/money","owner":"moneyphp","description":"PHP implementation of Fowler's Money pattern.","archived":false,"fork":false,"pushed_at":"2025-04-03T08:28:20.000Z","size":1370,"stargazers_count":4738,"open_issues_count":10,"forks_count":448,"subscribers_count":91,"default_branch":"master","last_synced_at":"2025-05-12T00:55:03.734Z","etag":null,"topics":["currency","currency-converter","currency-exchange-rates","fowler-money-pattern","money","php"],"latest_commit_sha":null,"homepage":"http://moneyphp.org","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moneyphp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-03-29T22:58:09.000Z","updated_at":"2025-05-10T08:04:35.000Z","dependencies_parsed_at":"2023-11-17T14:13:00.868Z","dependency_job_id":"716c6249-078e-4b91-8ff9-7aef2423f62a","html_url":"https://github.com/moneyphp/money","commit_stats":{"total_commits":729,"total_committers":103,"mean_commits":7.077669902912621,"dds":0.6817558299039781,"last_synced_commit":"142107bec4870ac2586057dc2fe917d25c92a91e"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneyphp%2Fmoney","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneyphp%2Fmoney/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneyphp%2Fmoney/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moneyphp%2Fmoney/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moneyphp","download_url":"https://codeload.github.com/moneyphp/money/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253655955,"owners_count":21943081,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["currency","currency-converter","currency-exchange-rates","fowler-money-pattern","money","php"],"created_at":"2024-08-01T11:01:05.776Z","updated_at":"2025-12-15T05:40:38.886Z","avatar_url":"https://github.com/moneyphp.png","language":"PHP","readme":"# Money\n\n[![Latest Version](https://img.shields.io/github/release/moneyphp/money.svg?style=flat-square)](https://github.com/moneyphp/money/releases)\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/moneyphp/money/ci.yml?branch=master\u0026style=flat-square)\n[![Total Downloads](https://img.shields.io/packagist/dt/moneyphp/money.svg?style=flat-square)](https://packagist.org/packages/moneyphp/money)\n\n[![Email](https://img.shields.io/badge/email-team@moneyphp.org-blue.svg?style=flat-square)](mailto:team@moneyphp.org)\n\n![Money PHP](/resources/logo.png?raw=true)\n\nPHP library to make working with money safer, easier, and fun!\n\n\u003e \"If I had a dime for every time I've seen someone use FLOAT to store currency, I'd have $999.997634\" -- [Bill Karwin](https://twitter.com/billkarwin/status/347561901460447232)\n\nIn short: You shouldn't represent monetary values by a float. Wherever\nyou need to represent money, use this Money value object. Since version\n3.0 this library uses [strings internally](https://github.com/moneyphp/money/pull/136)\nin order to support unlimited integers.\n\n```php\n\u003c?php\n\nuse Money\\Money;\n\n$fiveEur = Money::EUR(500);\n$tenEur = $fiveEur-\u003eadd($fiveEur);\n\nlist($part1, $part2, $part3) = $tenEur-\u003eallocate([1, 1, 1]);\nassert($part1-\u003eequals(Money::EUR(334)));\nassert($part2-\u003eequals(Money::EUR(333)));\nassert($part3-\u003eequals(Money::EUR(333)));\n```\n\nThe documentation is available at http://moneyphp.org\n\n\n## Requirements\n\nThis library requires the [BCMath PHP extension](https://www.php.net/manual/en/book.bc.php). There might be additional dependencies for specific feature, e.g. the\nSwap exchange implementation, check the documentation for more information.\n\nVersion 4 requires PHP 8.0. For older version of PHP, use version 3 of this library. From version 4.5 this package\nwill only support [PHP versions that actually receive updates by PHP itself](https://www.php.net/supported-versions.php).\nIf you want to use the package with older PHP versions, you can of course use older versions of this package.\n\n\n## Install\n\nVia Composer\n\n```bash\n$ composer require moneyphp/money\n```\n\n\n## Features\n\n- JSON Serialization\n- Big integer support utilizing different, transparent calculation logic upon availability (bcmath, gmp, plain php)\n- Money formatting (including intl formatter)\n- Currency repositories (ISO currencies included)\n- Money exchange (including [Swap](http://swap.voutzinos.org) implementation)\n\n\n## Documentation\n\nPlease see the [official documentation](http://moneyphp.org).\n\n\n## Testing\n\nWe try to follow TDD by using [phpunit](https://phpunit.de) to test this library.\n\n```bash\n$ composer test\n```\n\n### Running the tests in Docker\n\nMoney requires a set of dependencies, so you might want to run it in Docker.\n\nFirst, build the image locally:\n\n```bash\n$ docker build -t moneyphp .\n```\n\nThen run the tests:\n\n```bash\n$ docker run --rm -it -v $PWD:/app -w /app moneyphp vendor/bin/phpunit --exclude-group segmentation\n```\n\n\n## Contributing\n\nWe would love to see you helping us to make this library better and better.\nPlease keep in mind we do not use suffixes and prefixes in class names,\nso not `CurrenciesInterface`, but `Currencies`. Other than that, Style CI will help you\nusing the same code style as we are using. Please provide tests when creating a PR and clear descriptions of bugs when filing issues.\n\n\n## Security\n\nIf you discover any security related issues, please contact us at [team@moneyphp.org](mailto:team@moneyphp.org).\n\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n\n## Acknowledgements\n\nThis library is heavily inspired by [Martin Fowler's Money pattern](http://martinfowler.com/eaaCatalog/money.html).\nA special remark goes to [Mathias Verraes](https://github.com/mathiasverraes), without his contributions,\nin code and via his [blog](http://verraes.net/#blog), this library would not be where it stands now.\n","funding_links":[],"categories":["PHP","Table of Contents","目录","电子商务 E-commerce","电子商务( E-commerce )","类库"],"sub_categories":["E-commerce","电子商务 E-commerce","未归类"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoneyphp%2Fmoney","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoneyphp%2Fmoney","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoneyphp%2Fmoney/lists"}