Builds a clear specification of business rules, where objects can be checked against. The composite specification class has one method called isSatisfiedBy
that returns either true or false depending on whether the given object satisfies the specification.
You can also find this code on GitHub
Item.php
Item.php
Specification.php
Specification.php
OrSpecification.php
OrSpecification.php
PriceSpecification.php
PriceSpecification.php
AndSpecification.php
AndSpecification.php
NotSpecification.php
NotSpecification.php
Tests/SpecificationTest.php
Tests/SpecificationTest.php