Download the PHP package gosuperscript/schema-money without Composer
On this page you can find all versions of the php package gosuperscript/schema-money. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gosuperscript/schema-money
More information about gosuperscript/schema-money
Files in gosuperscript/schema-money
Package schema-money
Short Description Monetary extension for Axiom - provides schema types, parsers, and operators for monetary values with strong type safety and currency validation
License MIT
Homepage https://github.com/gosuperscript/axiom-money
Informations about the package schema-money
Axiom Money
A monetary extension for Axiom, providing schema types, parsers, and operators for monetary values with strong type safety and currency validation.
Note: This library extends Axiom (built on gosuperscript/schema) with monetary value support.
Features
- Schema Types: Type-safe monetary value handling with currency validation
- Money Parser: Parse monetary values from various string formats (e.g., "EUR 100", "£50.25")
- Operator Overloading: Mathematical operations on Money objects (addition, subtraction, multiplication, division, comparisons)
- Multiple Type Variants:
MonetaryType: Standard monetary type with currency validationMinorMonetaryType: Money from minor units (cents, pence, etc.)DynamicMonetaryType: Flexible parsing that auto-detects currencyMonetaryIntervalType: Intervals of monetary values
- Monetary Intervals: Support for ranges of monetary values
Requirements
- PHP 8.4 or higher
- ext-intl extension
Installation
Install via Composer:
Usage
Basic Money Types
Money Parser
Parse money from various string formats:
Minor Units
Work with minor currency units (cents, pence, etc.):
Dynamic Monetary Type
Automatically detect and parse currency from string:
Money Operations
Perform mathematical operations on Money objects:
Monetary Intervals
Work with ranges of monetary values:
Monetary Interval Operations
Development
Running Tests
Code Quality
The project enforces 100% code coverage and uses:
- PHPUnit: Unit testing
- PHPStan: Static analysis
- Laravel Pint: Code style
- Infection: Mutation testing
Linting
Dependencies
This library builds on several excellent packages:
- brick/money: Robust money and currency library
- gosuperscript/schema: Schema validation framework
- superscript/interval: Interval mathematics
- superscript/monetary-interval: Monetary interval support
License
MIT License - see LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate and maintain the existing code quality standards.
All versions of schema-money with dependencies
ext-intl Version *
brick/money Version ^0.10.1
gosuperscript/axiom Version ^0.4.0
superscript/interval Version ^1.0
superscript/monetary-interval Version ^0.1.2