定制 johnnymast/logichain 二次开发

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

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

johnnymast/logichain

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.

johnnymast/logichain 适用场景与选型建议

johnnymast/logichain 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 27 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「php」 「adapter」 「logic」 「pipeline」 「Chain」 「architecture」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 johnnymast/logichain 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 johnnymast/logichain 我们能提供哪些服务?
定制开发 / 二次开发

基于 johnnymast/logichain 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

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