PHPackages                             limen/php-graflow - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. limen/php-graflow

ActiveLibrary

limen/php-graflow
=================

A simple node flow controller

26PHP

Since Jan 31Pushed 8y agoCompare

[ Source](https://github.com/limen/php-graflow)[ Packagist](https://packagist.org/packages/limen/php-graflow)[ RSS](/packages/limen-php-graflow/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Graflow
=======

[](#graflow)

[![Build Status](https://camo.githubusercontent.com/00e9c54d4ec22d4a6de1828167df0db91357d92b2b7ab468c973be0a0f9fb6e6/68747470733a2f2f7472617669732d63692e6f72672f6c696d656e2f7068702d677261666c6f772e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/limen/php-graflow)[![Packagist](https://camo.githubusercontent.com/dceec4cf191e1f3ce813ebcd3707660c44eb3aa71f5a1a0b87a9d5b28e058c7b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6c696d656e2f7068702d677261666c6f772e7376673f6d61784167653d32353932303030)](https://packagist.org/packages/limen/php-graflow)

A simple flow controller with features

- A flow is defined by a graph.
- A graph is consisted of nodes and edges.
- Edges have direction.
- A graph can have one head node and one or multiple tail nodes.
- A middle node is a node who is neither head node nor tail node.
- A tail node can have one or multiple in nodes and have no out node.
- A head node can have one or multiple out nodes and have no in node.
- A middle node can have one or multiple in node and one or multiple out nodes.
- The edge between two adjacent nodes could be one way or two way.

Install
-------

[](#install)

Recommend to install via [composer](https://getcomposer.org/).

```
composer require "limen/php-graflow"
```

Usage
-----

[](#usage)

see **src/Examples** and **tests/**

Concepts
--------

[](#concepts)

### In/Out node

[](#inout-node)

When node A has way to node B, A is B's in node and B is A's out node.

Contract
--------

[](#contract)

### Define a graph in PHP array

[](#define-a-graph-in-php-array)

The first key must be the head node.

```
[
    'blank' => ['editing', 'canceled'],
    'editing' => ['draft', 'canceled'],
    'draft' => ['editing', 'published', 'canceled'],
    'published' => ['draft', 'printed', 'canceled'],
    'printed' => [],
    'canceled' => [],
]
```

The equivalent graph

[![graph](https://github.com/limen/resources/raw/master/graph.png)](https://github.com/limen/resources/blob/master/graph.png)

The arrow shows the way direction.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/49d0b6c3647be78ab9b2703cd07c681a8098a0815f2ac676da4e3eafd2c08474?d=identicon)[limen](/maintainers/limen)

---

Top Contributors

[![limen](https://avatars.githubusercontent.com/u/3460683?v=4)](https://github.com/limen "limen (9 commits)")

### Embed Badge

![Health badge](/badges/limen-php-graflow/health.svg)

```
[![Health](https://phpackages.com/badges/limen-php-graflow/health.svg)](https://phpackages.com/packages/limen-php-graflow)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
