netresearch/pipeline-factory 问题修复 & 功能扩展

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

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

netresearch/pipeline-factory

Composer 安装命令:

composer require netresearch/pipeline-factory

包简介

This Symfony bundle allows dynamically creating pipelines through dependency injection via league/pipeline

README 文档

README

This bundle enables you to create league/pipeline pipelines via service configuration.

Requirements

  • PHP 8.2 or higher
  • Symfony 5.4+, 6.4+, 7.3+, or 8.x
  • league/pipeline ^1.0

Installation

$ composer require netresearch/pipeline-factory

If you do not use Symfony Flex, you need to enable the bundle manually:

// config/bundles.php
return [
    // ...
    Netresearch\PipelineFactoryBundle\NetresearchPipelineFactoryBundle::class => ['all' => true],
];

Usage

Use the pipeline factory via your service container configuration:

# config/services.yaml
services:
    app.my.custom.pipeline:
        factory: [ 'Netresearch\PipelineFactoryBundle\Pipeline\Factory', create ]
        class: League\Pipeline\Pipeline
        arguments:
            $stages: !iterator [
                '@App\Pipeline\Stages\Stage1',
                '@App\Pipeline\Stages\Stage2',
                '@App\Pipeline\Stages\Stage3',
            ]
            # optional: set the pipeline processor
            $processor: '@App\Pipeline\Processor\MyCustomProcessor'

Alternatively you can pass in a collection of tagged services (e.g. tag them via autoconfiguration):

# config/services.yaml
services:
    App\Pipeline\Stages\:
        resource: '../src/Pipeline/Stages'
        tags: [ 'app.my.custom.pipeline.stage' ]

    app.my.custom.pipeline:
        factory: [ 'Netresearch\PipelineFactoryBundle\Pipeline\Factory', create ]
        class: League\Pipeline\Pipeline
        arguments:
            $stages: !tagged_iterator 'app.my.custom.pipeline.stage'

Via priority, you can control the order of the stages in this case.

Development

Testing

Run the test suite:

$ composer test

Generate code coverage report:

$ composer test-coverage

The coverage report will be available in the coverage/ directory. Open coverage/index.html in your browser to view detailed coverage information.

Code Style and Static Analysis

Use the following commands to ensure the source code conforms to our coding standards and guidelines:

  • composer phpcs to check PHP related files against the PSR-12 code style
  • composer rector to automatically comply with coding standards, simplify and improve code, and perform migrations (rules defined in ./rector.php)
  • composer phpstan for type and bug checking

Run the command composer analysis to run all static analysis checks at once.

Run all quality checks (analysis + tests):

$ composer quality

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-11-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固