定制 johnnymast/logichain 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

johnnymast/logichain

最新稳定版本:v0.10.0

Composer 安装命令:

composer require johnnymast/logichain

包简介

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

README 文档

README

Run Pest Tests License

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

Install LogicChain via Composer:

composer require johnnymast/logichain

After installation, all classes are available under the namespace:

JohnnyMast\LogicChain

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

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

© 2026 Johnny Mast — mastjohnny@gmail.com
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 file. Additional project notices can be found in the NOTICE file.

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2026-03-27

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固