定制 moirei/pipeline 二次开发

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

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

moirei/pipeline

最新稳定版本:0.3.0

Composer 安装命令:

composer require moirei/pipeline

包简介

Simple Laravel pipeline library.

README 文档

README

Amongst several pipeline packages, including Laravel's very own package, you might want a solution with a bit more regor for complex operations.

This package is intended for data processing and should not be a replacement for actions nor jobs. The concept of a pipeline here is a structured collection of micro tasks that happen in succession in order to yield a single output from a single input.

Documentation

All documentation is available at the documentation site.

Features

  • Utility operators
  • Pipeline context
  • Use closures, handler classes or context methods

Example

If you're used to RxJs, you might have an appreciation for the below example. There's technically no limit to what can be done with pipelines.

$value = Pipeline::with(0)->pipe([
    Pipeline::switch([
        fn ($v) => $v + 1,
        fn ($v) => $v + 2,
        fn ($v) => $v + 3,
    ]),
    Pipeline::map(
        fn ($v) => $v * 2,
    ),
    Pipeline::tap(function (array $value) {
        // do whatever
    }),
]);

// returns [2, 4, 6]

See rationale for a more exciting example.

Installation

composer require moirei/pipeline

Tests

composer test

Credits

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-12-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固