tourze / coupon-contracts
Coupon Contracts
0.1.0
2025-10-31 05:14 UTC
Requires
- composer-runtime-api: ^2.0
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5
This package is auto-updated.
Last update: 2026-03-07 11:27:16 UTC
README
A collection of PHP contracts/interfaces for coupon and coupon code management systems.
Installation
composer require tourze/coupon-contracts
Quick Start
This package provides two main interfaces for building coupon systems:
CouponInterface
The main interface for coupon objects:
<?php use Tourze\CouponContracts\CouponInterface; class MyCoupon implements CouponInterface { // Your coupon implementation }
CodeInterface
The interface for coupon code objects:
<?php use Tourze\CouponContracts\CodeInterface; class MyCouponCode implements CodeInterface { // Your coupon code implementation }
Usage
These interfaces are designed to be implemented by your coupon system classes. They provide a consistent contract for:
- Coupon management systems
- Coupon code generation and validation
- Integration with different coupon backends
Requirements
- PHP 8.1 or higher
Testing
composer test
License
This package is open-sourced software licensed under the MIT license.