Download the PHP package gosuperscript/schema-interval without Composer
On this page you can find all versions of the php package gosuperscript/schema-interval. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gosuperscript/schema-interval
More information about gosuperscript/schema-interval
Files in gosuperscript/schema-interval
Package schema-interval
Short Description A PHP library that extends gosuperscript/axiom with support for Interval types, providing type-safe interval handling and operator overloading for schema validation
License MIT
Informations about the package schema-interval
Axiom Interval
A PHP library that extends gosuperscript/axiom with support for Interval types, providing type-safe interval handling and operator overloading for schema validation.
Features
- Interval Type: Transform and validate interval values in your schemas
- Operator Overloading: Compare intervals with numeric values using standard comparison operators (
>,<,>=,<=) - Type Safety: Built with PHP 8.4+ strict types
- Format Support: Parse intervals from string notation (e.g.,
[1,2],(1,2)) - Comparison: Compare intervals for equality
Requirements
- PHP ^8.4
- ext-intl
- gosuperscript/axiom
- superscript/interval ^1.0.4
Installation
Install via Composer:
Usage
Interval Type
The IntervalType class provides type transformation, comparison, and formatting for interval values:
Interval Notation
Intervals can be specified using standard mathematical notation:
[1,2]- Closed interval (includes both endpoints)(1,2)- Open interval (excludes both endpoints)[1,2)- Half-open interval (includes left, excludes right)(1,2]- Half-open interval (excludes left, includes right)
Operator Overloading
The IntervalOverloader class enables comparison operations between intervals and numeric values:
Supported Operators
>- Greater than>=- Greater than or equal to<- Less than<=- Less than or equal to
Development
Testing
Run the full test suite:
Or run individual test suites:
Code Style
This project uses Laravel Pint for code formatting:
Docker Support
The project includes Docker configuration for development:
License
This project is licensed under the MIT License - see the LICENSE file for details.
Credits
- Built on superscript/interval
- Extends gosuperscript/axiom
All versions of schema-interval with dependencies
ext-intl Version *
gosuperscript/axiom Version ^0.4.0
superscript/interval Version ^1.0.4