fragoe/ddd-business-rules-specification 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

fragoe/ddd-business-rules-specification

最新稳定版本:v1.0.2

Composer 安装命令:

composer require fragoe/ddd-business-rules-specification

包简介

Core library implementing the Specification Pattern for DDD business rules with composable boolean operations.

README 文档

README

Tests codecov PHP Version License

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

composer require fragoe/ddd-business-rules-specification

Requirements: PHP ^8.3

Usage

Extend CompositeBusinessRule and implement isSatisfiedBy(). Compose rules using the fluent API.

See tests/CompositeBusinessRulesTest.php for comprehensive usage examples including rule creation, composition, and fluent chaining. For a real-world domain example, 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:

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

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-22

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固