diff options
| author | Brett Parson <brett@brett-parson.com> | 2026-08-21 13:55:37 -0500 |
|---|---|---|
| committer | Brett Parson <brett@brett-parson.com> | 2026-08-21 14:00:11 -0500 |
| commit | d039a5d62a9ac6ababae70d9d96422ca59f2b2d4 (patch) | |
| tree | f0db4750a571e8040a5da02cc7190079c0d62914 /src/Middleware/MiddlewareInterface.php | |
| parent | 0de77a6334cee1f6e15f7e0fd35602514560be33 (diff) | |
| download | miniroute-d039a5d62a9ac6ababae70d9d96422ca59f2b2d4.tar.gz miniroute-d039a5d62a9ac6ababae70d9d96422ca59f2b2d4.zip | |
Scaffold miniroute routing/middleware kernel
Diffstat (limited to 'src/Middleware/MiddlewareInterface.php')
| -rw-r--r-- | src/Middleware/MiddlewareInterface.php | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Middleware/MiddlewareInterface.php b/src/Middleware/MiddlewareInterface.php new file mode 100644 index 0000000..3d21a3f --- /dev/null +++ b/src/Middleware/MiddlewareInterface.php @@ -0,0 +1,21 @@ +<?php + +declare(strict_types=1); + +namespace BrettParson\MiniRoute\Middleware; + +use BrettParson\MiniRoute\Http\RequestInterface; +use BrettParson\MiniRoute\Http\ResponseInterface; + +interface MiddlewareInterface +{ + /** + * Process the request and either short-circuit with a Response or pass + * control to $next. + * + * Middleware may wrap $next to post-process the response. + * + * @param callable(RequestInterface): ResponseInterface $next + */ + public function handle(RequestInterface $request, callable $next): ResponseInterface; +} |
