Download the PHP package fragoe/ddd-business-rules-specification without Composer
On this page you can find all versions of the php package fragoe/ddd-business-rules-specification. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download fragoe/ddd-business-rules-specification
More information about fragoe/ddd-business-rules-specification
Files in fragoe/ddd-business-rules-specification
Package ddd-business-rules-specification
Short Description Core library implementing the Specification Pattern for DDD business rules with composable boolean operations.
License MIT
Informations about the package ddd-business-rules-specification
DDD Business Rules Specification
A lightweight PHP library implementing the Specification Pattern for Domain-Driven Design. Compose business rules with a fluent API using and(), or(), not(), and xor().
Installation
Requirements: PHP ^8.3
Usage
Extend CompositeBusinessRule and implement isSatisfiedBy(). Compose rules using the fluent API.
See tests/CoffeeExamplesTest.php.
Built-in Composites
| Class | Description |
|---|---|
AndBusinessRule |
All rules must be satisfied |
OrBusinessRule |
At least one rule must be satisfied |
XorBusinessRule |
Exactly one rule must be satisfied |
NotBusinessRule |
Inverts the rule result |
Design Philosophy
This library follows strict DDD principles and intentionally excludes infrastructure concerns. Database queries, visualization, and validation framework integration are handled by companion packages:
- ddd-business-rules-doctrine - Doctrine bridge
- ddd-business-rules-analyzer - Static analysis and visualization
Package Ecosystem
| Package | Description |
|---|---|
| fragoe/ddd-business-rules | Meta package |
| fragoe/ddd-business-rules-specification | Core library (this package) |
| fragoe/ddd-business-rules-doctrine | Doctrine bridge |
| fragoe/ddd-business-rules-validation | Validation integration |
| fragoe/ddd-business-rules-analyzer | Analysis tools |
License
MIT - See LICENSE