PHPackages                             devhelp/flow-control - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. devhelp/flow-control

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

devhelp/flow-control
====================

component that allows to control state changes in the flow.

1.0(11y ago)0971MITPHPPHP &gt;=5.3.3

Since Oct 4Pushed 11y ago2 watchersCompare

[ Source](https://github.com/devhelp/flow-control)[ Packagist](https://packagist.org/packages/devhelp/flow-control)[ Docs](http://devhelp.pl)[ RSS](/packages/devhelp-flow-control/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

[![Build Status](https://camo.githubusercontent.com/b37a90942373cbe0e3257f09772a8c3a3643ffd7faa9d721d0793e80f68710e0/68747470733a2f2f7472617669732d63692e6f72672f64657668656c702f666c6f772d636f6e74726f6c2e706e67)](https://travis-ci.org/devhelp/flow-control) [![SensioLabsInsight](https://camo.githubusercontent.com/55a323d1ce5beaeb29a16e001fd77bbe78b968b0748652c9370989d855b07491/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f66323031363837632d383935312d346561392d396663652d6165643061346432303436612f6d696e692e706e67)](https://insight.sensiolabs.com/projects/f201687c-8951-4ea9-9fce-aed0a4d2046a)

Installation
------------

[](#installation)

Composer is preferred to install Flow Control, please check [composer website](http://getcomposer.org) for more information.

```
$ composer require 'devhelp/flow-control:dev-master'

```

Purpose
-------

[](#purpose)

Flow Control is a simple tool that allows to control the flow defined in the Flow class.

Two main classes are Flow and FlowControl. Flow is defined using moves array and entry points. FlowControl is used to control state changes in flows.

Concept of the flow is general, some obvious use case can be, to define and control flow in checkout process

Usage
-----

[](#usage)

```
//two way flow with optional 'step_c'
$exampleFlowA = new Flow(
    'flow_a',
    array(
        'step_a' => array('step_b'),
        'step_b' => array('step_a', 'step_c', 'step_d'),
        'step_c' => array('step_b', 'step_d'),
        'step_d' => array('step_b', 'step_c')
    ),
    array('step_a')
);

//one way flow
$exampleFlowB = new Flow(
    'flow_b',
    array(
        'step_a' => array('step_b'),
        'step_b' => array('step_c'),
        'step_c' => array('step_d'),
    ),
    array('step_a')
);

$flows = array($exampleFlowA, $exampleFlowB);

$repository = new SimpleFlowRepository($flows);

$flowControl = new FlowControl($repository);

/**
 * origin of current steps is out of the scope of FlowControl component,
 * the same is regarding changing the state in the flow. FlowControl
 * is only for resolving valid moves
 */
$currentSteps = array(
    'flow_a' => 'step_c',
);

$flowControl->setFlowSteps($currentSteps);

$flowControl->isAllowed('step_d', 'flow_a'); //true
$flowControl->isAllowed('step_a', 'flow_a'); //false
$flowControl->isAllowed('step_c', 'flow_a'); //true
$flowControl->isAllowed('step_a', 'flow_b'); //true
$flowControl->isAllowed('step_b', 'flow_b'); //false

$moves = array(
    'flow_a' => 'step_d',
    'flow_b' => 'step_b',
);

$validMoves = $flowControl->resolveValid($moves); //array('flow_a' => 'step_d')

```

Credits
-------

[](#credits)

Brought to you by : Devhelp.pl ()

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4244d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1479355?v=4)[devhelp](/maintainers/devhelp)[@devhelp](https://github.com/devhelp)

---

Top Contributors

[![pawelbaranski](https://avatars.githubusercontent.com/u/219097?v=4)](https://github.com/pawelbaranski "pawelbaranski (13 commits)")

---

Tags

flow

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/devhelp-flow-control/health.svg)

```
[![Health](https://phpackages.com/badges/devhelp-flow-control/health.svg)](https://phpackages.com/packages/devhelp-flow-control)
```

###  Alternatives

[phpmentors/workflower

A BPMN 2.0 workflow engine for PHP

70652.9k4](/packages/phpmentors-workflower)[shel/neos-hyphens

A plugin for Neos CMS which provides hyphens for the inline editor

20200.7k1](/packages/shel-neos-hyphens)[techdivision/ckstyles

Neos package which enables you adding your custom style classes for the CkEditor with a simple Yaml configuration

21166.3k](/packages/techdivision-ckstyles)[moc/notfound

Neos CMS package that loads a normal editable page for displaying a 404 error

18167.5k](/packages/moc-notfound)[carbon/includeassets

Include your assets (css, js) in an easy way into Neos

14228.6k10](/packages/carbon-includeassets)[shel/neos-colorpicker

A plugin for Neos CMS which provides a colorpicker editor

1494.4k6](/packages/shel-neos-colorpicker)

PHPackages © 2026

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