italystrap/pipeline 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

italystrap/pipeline

Composer 安装命令:

composer require italystrap/pipeline

包简介

A lightweight middleware pipeline for PHP — chain handlers and middleware to process messages through a composable pipeline

README 文档

README

A lightweight, zero-dependency middleware pipeline for PHP.

Route any object through a composable pipeline of middleware before reaching a final handler — inspired by the HTTP middleware pattern (PSR-15).

Installation

composer require italystrap/pipeline

Quick Start

use ItalyStrap\Pipeline\Pipeline;
use ItalyStrap\Pipeline\CallbackHandler;
use ItalyStrap\Pipeline\HandlerInterface;
use ItalyStrap\Pipeline\MiddlewareInterface;

// 1. Define a message (any object mutable or immutable)
$message = new User(name: 'Alice', email: 'alice@example.com');

// 2. Create a pipeline with a handler and middleware
$handler = new Pipeline(
    new CallbackHandler(static function (object $message): string {
        // final handler logic
        return 'User created: ' . $message->name;
    }),
    new LoggingMiddleware(),
    new ValidationMiddleware(),
);

// 3. Dispatch when ready
$result = $handler->handle($message);

The message flows through middleware in the order they were provided, then reaches the handler.

Documentation

License

MIT — see LICENSE.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固