stratadox / specification
Php7 的规范模式实现
v1.0.2
2017-12-20 02:36 UTC
Requires
- php: >=7.0
- stratadox/specification-interfaces: ^1.0
Requires (Dev)
- phpunit/phpunit: ^6.2
- satooshi/php-coveralls: ^1.0
This package is auto-updated.
Last update: 2024-09-29 04:25:55 UTC
README
Php7 规范模式的实现
安装
使用 composer 安装
composer require stratadox/specification
使用示例
// The business logic $allBoxes = CollectionOfBoxes::containing( Box::ofWeight(1), Box::ofWeight(2), Box::ofWeight(3), Box::ofWeight(5), Box::ofWeight(12), Box::ofWeight(26) ); $weighBetween2and10 = AreHeavier::than(2)->and(AreLighter::than(10)); $this->assertEquals( CollectionOfBoxes::containing( Box::ofWeight(3), Box::ofWeight(5), Box::ofWeight(26) ), $allBoxes->that($weighBetween2and10->or(AreHeavier::than(20))) );