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 these code on GitHub
Item.php
Item.php
SpecificationInterface.php
SpecificationInterface.php
AbstractSpecification.php
AbstractSpecification.php
Either.php
Either.php
PriceSpecification.php
PriceSpecification.php
Plus.php
Plus.php
Not.php
Not.php
Tests/SpecificationTest.php
Tests/SpecificationTest.php