Download the PHP package kariricode/processor-pipeline without Composer
On this page you can find all versions of the php package kariricode/processor-pipeline. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kariricode/processor-pipeline
More information about kariricode/processor-pipeline
Files in kariricode/processor-pipeline
Package processor-pipeline
Short Description A robust, immutable processor pipeline component for the KaririCode Framework — ARFA 1.3 compliant. Enables modular, configurable processing chains for data transformation, validation, and sanitization.
License MIT
Homepage https://kariricode.org
Informations about the package processor-pipeline
KaririCode ProcessorPipeline
The Problem
Building reusable data-processing chains in PHP typically means either rigid class hierarchies or ad-hoc chains of function calls that are hard to test, configure, and compose:
No registry, no configuration per processor, no error collection, no immutability — just imperative code you copy-paste everywhere.
The Solution
Requirements
| Requirement | Version |
|---|---|
| PHP | 8.4 or higher |
| kariricode/contract | ^2.8 |
| kariricode/exception | ^1.2 |
Installation
Quick Start
Define processors, register them, build a pipeline, execute:
Features
Immutable Pipelines (ARFA P1)
Pipeline is a readonly class. Adding processors returns a new instance — the original is never modified:
Context-Based Registry
Processors are namespaced by context — no name collisions across domains:
Flexible Specification Format
Build pipelines with simple lists, enable/disable flags, or per-processor configuration:
Configurable Processors
ConfigurableProcessor allows per-build configuration without constructing new instances:
Error Collection via ProcessorHandler
Wrap processors for non-halting error collection — useful in validation scenarios:
PHP 8.4 Attributes
Use #[Process] to declare pipelines declaratively on entity properties:
Structured Exceptions
All exceptions carry a context array for structured logging and tracing:
The Pipeline
Architecture
Source layout
Key design decisions
| Decision | Rationale | ADR |
|---|---|---|
Immutable readonly Pipeline |
Eliminates shared-state bugs; safe to reuse across requests | ADR-001 |
| Context-based registry | Prevents name collisions between validator/sanitizer/transformer domains | ADR-002 |
| Flexible spec format | Same interface for simple lists and richly-configured pipelines | ADR-003 |
ProcessorHandler wrapper |
Decouples error collection from processor logic; supports halt-or-continue | — |
PipelineExecutionException with stage context |
Structured observability — which stage, which processor, which cause | — |
Specifications
| Spec | Covers |
|---|---|
| SPEC-001 | Full pipeline: registry → builder → execution → error collection |
Integration with the KaririCode Ecosystem
ProcessorPipeline is the execution engine used internally by other KaririCode components:
| Component | Role |
|---|---|
kariricode/validator |
Builds validation pipelines from #[Validate] attributes |
kariricode/sanitizer |
Builds sanitization pipelines from #[Sanitize] attributes |
kariricode/transformer |
Builds transformation pipelines from #[Transform] attributes |
kariricode/property-inspector |
Discovers #[Process] attributes and dispatches to pipeline handlers |
Any component that needs configurable, composable processing chains can be built on top of this engine.
Project Stats
| Metric | Value |
|---|---|
| PHP source files | 8 |
| External runtime dependencies | 2 (contract · exception) |
| Test suite | 128 tests · 234 assertions |
| PHPStan level | 9 |
| Code coverage | 100% classes / methods / lines |
| PHP version | 8.4+ |
| ARFA compliance | 1.3 |
| Test suites | Unit + Integration |
Contributing
License
Walmir Silva