Skip to content

Latest commit

 

History

History
64 lines (43 loc) · 1.04 KB

README.rst

File metadata and controls

64 lines (43 loc) · 1.04 KB

Purpose

Encapsulate varying behavior for the same routine based on an object's state. This can be a cleaner way for an object to change its behavior at runtime without resorting to large monolithic conditional statements.

UML Diagram

Alt State UML Diagram

Code

You can also find this code on GitHub

OrderContext.php

OrderContext.php

State.php

State.php

StateCreated.php

StateCreated.php

StateShipped.php

StateShipped.php

StateDone.php

StateDone.php

Test

Tests/StateTest.php

Tests/StateTest.php