timitao/value-object
Composer 安装命令:
composer require timitao/value-object
包简介
README 文档
README
Why
This library provides typed Value Objects in the spirit of Domain-Driven Design: immutable, compared by value and by type. It keeps contracts (interfaces) separate from implementations, offers both Required (non-null) and Nullable variants, and has no framework dependency—you can depend only on the contract package or use the default implementations.
Installation
composer require timitao/value-object
Usage
Extend one of the standard value object classes and use equals() for type-safe value comparison (same concrete class and same value):
use TimiTao\ValueObject\Standard\Required\AbstractClass\ValueObject\StringValueObject; final class Title extends StringValueObject {} $a = new Title('Hello'); $b = new Title('Hello'); $c = new Title('World'); $a->equals($b); // true — same class, same value $a->equals($c); // false — same class, different value
Architecture decision records
- Record architecture decisions
- Strict code style
- Use of Beberlei/assert library
- Split nullable and standard in 2 namespaces
- Change facade for Beberlei extension uses
Versioning
Staring version 1.0.0, will follow Semantic Versioning v2.0.0.
Contributors
- Tomasz Kunicki TimiTao [lead developer]
统计信息
- 总下载量: 1.51k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 4
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2018-09-14