PHPackages                             johnnymast/logichain - 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. johnnymast/logichain

ActiveLibrary

johnnymast/logichain
====================

A SOLID-friendly pipeline engine for structuring business logic into clean, composable chains.

v0.10.0(1mo ago)01↑2900%Apache-2.0PHPPHP &gt;=8.3CI passing

Since Mar 27Pushed 1mo agoCompare

[ Source](https://github.com/johnnymast/logichain)[ Packagist](https://packagist.org/packages/johnnymast/logichain)[ GitHub Sponsors](https://github.com/johnnymast)[ Fund](https://ko-fi.com/johnnymast)[ RSS](/packages/johnnymast-logichain/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (3)Used By (0)

[![Run Pest Tests](https://github.com/johnnymast/workflow-php/actions/workflows/tests.yml/badge.svg)](https://github.com/johnnymast/workflow-php/actions/workflows/tests.yml)[![License](https://camo.githubusercontent.com/7473b9e8f925b5d2996f6c5c0429fec0b36e3d7b08d58af9f128ce4fc7d39a6e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4170616368655f322e302d70696e6b2e737667)](https://www.apache.org/licenses/LICENSE-2.0)

LogicChain
==========

[](#logicchain)

Workflow is built on a simple belief: complex logic shouldn’t feel complex. This library gives you a clean, expressive way to structure multi‑step processes without drowning in conditionals, flags, or scattered service calls. Every workflow becomes a clear, linear story — one step at a time — with predictable behavior and a result you can always trust.

Whether you’re transforming data, orchestrating services, or coordinating real‑world business operations, Workflow helps you keep your code honest and your intent visible. No magic, no hidden state, no surprises. Just a lightweight pipeline that does exactly what you tell it to do.

It’s designed for developers who care about clarity. For teams that value maintainability. And for projects where the flow of logic matters just as much as the outcome.

If you’ve ever wished your application logic read more like a narrative and less like a maze, you’ll feel right at home here.

Large features that once required hundreds or even thousands of lines of orchestration logic can now be expressed as a simple, readable pipeline:

```
use JohnnyMast\LogicChain\Workflow;
use Examples\Invokables\ValidateOrder;
use Examples\Invokables\CreateOrder;
use Examples\Invokables\StoreOrder;
use Examples\Invokables\SendOrderEmail;

$workflow = (new Workflow())
    ->add(new ValidateOrder())
    ->add(new CreateOrder())
    ->add(new StoreOrder())
    ->add(new SendOrderEmail())
    ->success(fn($r) => print "Order completed\n")
    ->failed(fn($r) => print "Order failed: {$r->context->error}\n");

$result = $workflow->run([
    'customer' => 'john@example.com',
    'items' => ['sku-123', 'sku-456'],
]);
```

That’s the entire flow — end to end.
No scattered service calls, no deeply nested conditionals, no hidden state.
Just a clean sequence of steps that tells the story of what your application is doing.

---

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

[](#installation)

Install LogicChain via Composer:

```
composer require johnnymast/logichain
```

After installation, all classes are available under the namespace:

```
JohnnyMast\LogicChain
```

---

Examples &amp; Use Cases
------------------------

[](#examples--use-cases)

LogicChain includes a collection of practical examples that demonstrate how to build and structure chains for different scenarios.
If you want to explore real‑world use cases or see how to apply the library in your own projects, check the `examples/` directory in the project root.

The examples show:

- how to build a simple chain
- how to pass context between steps
- how to handle success and failure callbacks
- how to structure reusable step classes
- how to orchestrate multi‑step business logic

Exploring the examples is the quickest way to understand how LogicChain works in real applications.

---

Apache 2.0 License
------------------

[](#apache-20-license)

LogicChain is licensed under the Apache License, Version 2.0 (Apache-2.0).

© 2026 Johnny Mast —
You may use this project in commercial and private applications under the terms of the Apache 2.0 license.

See the full license in the [LICENSE.md](LICENSE.md) file. Additional project notices can be found in the [NOTICE](NOTICE) file.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance90

Actively maintained with recent releases

Popularity2

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d5a228d3118e6b9e3c3c189ea1c8d3a13ed4c9ac312b9217654c81f6d4214cc8?d=identicon)[johnnymast](/maintainers/johnnymast)

---

Top Contributors

[![johnnymast](https://avatars.githubusercontent.com/u/121194?v=4)](https://github.com/johnnymast "johnnymast (74 commits)")

---

Tags

automationlibrarylogicphppipelineworkflowphpadapterarchitectureclean codelogicpipelineChainchain of responsibilitybusiness logiclogic-chain

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/johnnymast-logichain/health.svg)

```
[![Health](https://phpackages.com/badges/johnnymast-logichain/health.svg)](https://phpackages.com/packages/johnnymast-logichain)
```

###  Alternatives

[tbolier/php-rethink-ql

A clean and solid RethinkDB driver for PHP.

5211.7k](/packages/tbolier-php-rethink-ql)

PHPackages © 2026

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