Behavioral/ChainOfResponsibilities/README.rst
Chain Of Responsibilities__To build a chain of objects to handle a call in sequential order. If one object cannot handle a call, it delegates the call to the next in the chain and so forth.
.. image:: uml/uml.png :alt: Alt ChainOfResponsibility UML Diagram :align: center
You can also find this code on GitHub_
Handler.php
.. literalinclude:: Handler.php :language: php :linenos:
Responsible/FastStorage.php
.. literalinclude:: Responsible/HttpInMemoryCacheHandler.php :language: php :linenos:
Responsible/SlowStorage.php
.. literalinclude:: Responsible/SlowDatabaseHandler.php :language: php :linenos:
Tests/ChainTest.php
.. literalinclude:: Tests/ChainTest.php :language: php :linenos:
.. _GitHub: https://github.com/DesignPatternsPHP/DesignPatternsPHP/tree/main/Behavioral/ChainOfResponsibilities
.. __: http://en.wikipedia.org/wiki/Chain_of_responsibility_pattern