FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [View Raw Code]   [Original HTTPS Page]

DesignPatternsPHP/Behavioral/Specification at flyweight · JavaDevl/DesignPatternsPHP · GitHub

Latest commit

 

History

History
 
 

README.rst

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

Code

You can also find these code on GitHub

Item.php

.. literalinclude:: Item.php
   :language: php
   :linenos:

SpecificationInterface.php

.. literalinclude:: SpecificationInterface.php
   :language: php
   :linenos:

AbstractSpecification.php

.. literalinclude:: AbstractSpecification.php
   :language: php
   :linenos:

Either.php

.. literalinclude:: Either.php
   :language: php
   :linenos:

PriceSpecification.php

.. literalinclude:: PriceSpecification.php
   :language: php
   :linenos:

Plus.php

.. literalinclude:: Plus.php
   :language: php
   :linenos:

Not.php

.. literalinclude:: Not.php
   :language: php
   :linenos:

Test

Tests/SpecificationTest.php

.. literalinclude:: Tests/SpecificationTest.php
   :language: php
   :linenos:


Back | FazBrowse Home | New Git URL