Skip to content

Commit d7c6f06

Browse files
committed
Updated readme, added workflows
1 parent 22edf9c commit d7c6f06

File tree

3 files changed

+53
-16
lines changed

3 files changed

+53
-16
lines changed

.github/stale.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
daysUntilStale: 30
2+
daysUntilClose: 7
3+
exemptLabels:
4+
- pinned
5+
- security
6+
staleLabel: wontfix
7+
markComment: >
8+
This issue has been automatically marked as stale because it has not had
9+
recent activity. It will be closed if no further activity occurs. Thank you
10+
for your contributions.
11+
closeComment: false

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
11+
build:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
php: ['7.4', '8.0']
17+
18+
steps:
19+
- name: Set up PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: ${{ matrix.php }}
23+
coverage: none
24+
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
28+
- name: Download dependencies
29+
uses: ramsey/composer-install@v1
30+
with:
31+
composer-options: --no-interaction --prefer-dist --optimize-autoloader
32+
33+
- name: Run tests
34+
run: ./vendor/bin/phpunit

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
11
# State Engine (PHP)
22

3+
[![CI](https://github.com/uuf6429/state-engine-php/workflows/CI/badge.svg)](https://github.com/uuf6429/state-engine-php/actions/workflows/ci.yml)
4+
[![Minimum PHP Version](https://img.shields.io/badge/php-%5E7.4%20%7C%20%5E8-8892BF.svg)](https://php.net/)
5+
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/uuf6429/state-engine-php/main/LICENSE)
6+
[![Packagist](https://img.shields.io/packagist/v/uuf6429/state-engine.svg)](https://packagist.org/packages/uuf6429/state-engine)
7+
38
This library provides some interfaces and a basic implementation of a State Engine.
49

510
**Highlights:**
611
- 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
813
- Fluent interface
914
- Generates PlantUML markup
1015

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-
2416
## Installation
2517

2618
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
6052

6153
Here's a quick & dirty example with the provided implementation (that assumes that there is a "door" model):
6254

63-
```injectablephp
55+
```php
6456
use App\Models\Door; // example model
6557

6658
use uuf6429\StateEngine\Implementation\Builder;
@@ -101,7 +93,7 @@ For example, you could store states or transitions in a database, in which case
10193
The library provides some flexibility so that you can connect your existing code with it. In more complicated scenarios,
10294
you may have to build a small layer to bridge the gap. The example below illustrates how one can handle models with
10395
flags instead of a single state.
104-
```injectablephp
96+
```php
10597
use App\Models\Door; // example model
10698

10799
use uuf6429\StateEngine\Implementation\Builder;

0 commit comments

Comments
 (0)