Download the PHP package dynamik-dev/zenpipe-php without Composer
On this page you can find all versions of the php package dynamik-dev/zenpipe-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dynamik-dev/zenpipe-php
More information about dynamik-dev/zenpipe-php
Files in dynamik-dev/zenpipe-php
Package zenpipe-php
Short Description A simple, fluent pipeline implementation for PHP.
License MIT
Informations about the package zenpipe-php
ZenPipe
ZenPipe is a simple and flexible PHP pipeline library that allows you to chain operations together to process, transform, or act on input.
You can also run the pipeline on demand:
Sections
- ZenPipe
- Requirements
- Installation
- Usage
- Pipeline Operations
- Class Methods as Operations
- More Examples
- API Reference
- Contributing
- License
- Roadmap
Requirements
- PHP 8.2 or higher
Installation
Usage
Pipeline Operations
Pipeline operations are functions that take an input and return a processed value. Each operation can receive up to three parameters:
$input
: The value being processed$next
: A callback to pass the value to the next operation$return
: (Optional) A callback to exit the pipeline early with a value
Basic Operation Example
Let's build an input sanitization pipeline:
Operation with Early Return
Below is a practical example of a content moderation pipeline with early returns:
Class Methods as Operations
You can also use class methods as operations, with the same parameter options:
You can also pass an array of operations:
More Examples
RAG Processes
This pipeline can be used for RAG processes, where the output of one model is used as input for another.
Email Validation with Early Return
This pipeline demonstrates early returns for email validation:
API Reference
See API Reference for details.
Contributing
See CONTRIBUTING.md for details.
License
The MIT License (MIT). See LICENSE for details.
Roadmap
- [ ] Add support for PSR-15 middleware