File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1-
2- * Remark: It's a work-in-progress project! Wanna contribute? Let me know.*
3-
41# State Machine Framework for PHP
52
63Maybe state machines are not what you usually do with PHP but when you do... just use this.
4+ This simple yet powerful framework will keep your state machines within their desired state
5+ transition cycles. You can also modify their behavior whilst running or just configure them
6+ dynamically and launch. You can define state transition conditions you want based upon
7+ anonymous functions or class methods. Fire events on each state transition with your favorite
8+ event dispatcher.
79
810
911## Usage example
1012
11- ### State dictionary
13+ ### States' dictionary
1214
1315``` php
1416
17+ /**
18+ * @method static DRAFT()
19+ * @method static SENT()
20+ * ... // this should make your IDE believe those method exist
21+ *
22+ */
1523 class PetitionEnum extends StateEnum {
1624 const __default = self::DRAFT,
1725 DRAFT = 'draft',
@@ -114,4 +122,4 @@ Maybe state machines are not what you usually do with PHP but when you do... jus
114122 // State changed from voted to accepted
115123
116124```
117-
125+
You can’t perform that action at this time.
0 commit comments