Skip to content

Latest commit

 

History

History

Specification

Purpose

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.

Examples

UML Diagram

Alt Specification UML Diagram

Code

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

Test

Tests/SpecificationTest.php

Tests/SpecificationTest.php