Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phwoolcon/fsm
Phwoolcon state machine
https://github.com/phwoolcon/fsm
finite-state-machine
Last synced: 3 months ago
JSON representation
Phwoolcon state machine
- Host: GitHub
- URL: https://github.com/phwoolcon/fsm
- Owner: phwoolcon
- License: apache-2.0
- Created: 2016-05-16T07:57:13.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-10-11T07:04:38.000Z (over 5 years ago)
- Last Synced: 2024-05-05T14:20:19.937Z (9 months ago)
- Topics: finite-state-machine
- Language: PHP
- Size: 20.5 KB
- Stars: 13
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Phwoolcon Finite State Machine
[![Build Status](https://travis-ci.org/phwoolcon/fsm.svg?branch=master)](https://travis-ci.org/phwoolcon/fsm)
[![Code Coverage](https://codecov.io/gh/phwoolcon/fsm/branch/master/graph/badge.svg)](https://codecov.io/gh/phwoolcon/fsm)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)See the definition of [Finite-state machine](https://en.wikipedia.org/wiki/Finite-state_machine) on Wikipedia
## Installation
Add this library to your project by composer:```
composer require "phwoolcon/fsm"
```## Usage
```php
[
'process' => 'bar',
],
'bar' => [
'process2' => 'hello',
'process3' => 'world',
],
]);
echo $fsm->getCurrentState(); // prints foo
echo $fsm->next(); // prints bar
echo $fsm->do('process2'); // prints hello
```