|
1 | 1 | # State Engine (PHP) |
2 | 2 |
|
| 3 | +[](https://github.com/uuf6429/state-engine-php/actions/workflows/ci.yml) |
| 4 | +[](https://php.net/) |
| 5 | +[](https://raw.githubusercontent.com/uuf6429/state-engine-php/main/LICENSE) |
| 6 | +[](https://packagist.org/packages/uuf6429/state-engine) |
| 7 | + |
3 | 8 | This library provides some interfaces and a basic implementation of a State Engine. |
4 | 9 |
|
5 | 10 | **Highlights:** |
6 | 11 | - Highly composable - everything can be replaced as desired |
7 | | -- PSR-14 (Event Dispatcher) compatible |
| 12 | +- [PSR-14](http://www.php-fig.org/psr/psr-14/) (Event Dispatcher) compatible |
8 | 13 | - Fluent interface |
9 | 14 | - Generates PlantUML markup |
10 | 15 |
|
11 | | -## Table Of Contents |
12 | | - |
13 | | -- [State Engine (PHP)](#state-engine-php) |
14 | | - - [Table Of Contents](#table-of-contents) |
15 | | - - [Installation](#installation) |
16 | | - - [Why?](#why) |
17 | | - - [How?](#how) |
18 | | - - [Usage](#usage) |
19 | | - - [From Scratch](#from-scratch) |
20 | | - - [From Scratch (Custom)](#from-scratch-custom) |
21 | | - - [Existing Code](#existing-code) |
22 | | - - [Examples & Testing](#examples--testing) |
23 | | - |
24 | 16 | ## Installation |
25 | 17 |
|
26 | 18 | The recommended and easiest way to install this library is through [Composer](https://getcomposer.org/): |
@@ -60,7 +52,7 @@ Usage depends on if you want to do it from scratch or plug it into your existing |
60 | 52 |
|
61 | 53 | Here's a quick & dirty example with the provided implementation (that assumes that there is a "door" model): |
62 | 54 |
|
63 | | -```injectablephp |
| 55 | +```php |
64 | 56 | use App\Models\Door; // example model |
65 | 57 |
|
66 | 58 | use uuf6429\StateEngine\Implementation\Builder; |
@@ -101,7 +93,7 @@ For example, you could store states or transitions in a database, in which case |
101 | 93 | The library provides some flexibility so that you can connect your existing code with it. In more complicated scenarios, |
102 | 94 | you may have to build a small layer to bridge the gap. The example below illustrates how one can handle models with |
103 | 95 | flags instead of a single state. |
104 | | -```injectablephp |
| 96 | +```php |
105 | 97 | use App\Models\Door; // example model |
106 | 98 |
|
107 | 99 | use uuf6429\StateEngine\Implementation\Builder; |
|
0 commit comments