fitdev-pro / middleware
Simply middleware Implementation.
Installs: 77
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/fitdev-pro/middleware
Requires (Dev)
- phpunit/phpunit: ^6.1
This package is not auto-updated.
Last update: 2025-10-12 08:30:04 UTC
README
Simply Middleware Implementation.
Installation
composer require fitdev-pro/middleware
Usage
Base usage
<?php $hundler = new MiddlewareHundler(new Resolver(), new Queue()); $hundler->append(Foo/Bar/SomeClass::class); $hundler->append(function ($input, $output, $next){ $data += 1; return $next($data); }); $hundler->append(function ($input, $output, $next){ $data += 2; if($data > 4){ return $data; } return $next($data); }); $hundler->append(function ($input, $output, $next){ $data += 3; return $next($data); }); $newData = $hundler->hundle(2);
Contribute
Please feel free to fork and extend existing or add new plugins and send a pull request with your changes! To establish a consistent code quality, please provide unit tests for all your changes and may adapt the documentation.
License
The MIT License (MIT). Please see License File for more information.