File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace Bermuda \Http \Middleware \Tests ;
6+
7+ use Psr \Http \Message \ResponseInterface ;
8+ use Psr \Http \Message \ServerRequestInterface ;
9+ use Psr \Http \Server \MiddlewareInterface ;
10+ use Psr \Http \Server \RequestHandlerInterface ;
11+
12+ /**
13+ * Test middleware class used for verifying class-based middleware detection.
14+ *
15+ * This class is used in tests to verify that the Pipeline::has() method
16+ * can correctly identify middleware by their fully-qualified class name.
17+ * It implements pass-through behavior, delegating all requests to the next handler.
18+ */
19+ final class TestMiddleware implements MiddlewareInterface
20+ {
21+ /**
22+ * Processes an incoming server request and returns a response.
23+ *
24+ * This is a pass-through implementation that immediately delegates
25+ * to the next handler in the chain without any modifications.
26+ *
27+ * @param ServerRequestInterface $request The incoming server request.
28+ * @param RequestHandlerInterface $handler The next handler in the chain.
29+ * @return ResponseInterface The response from the next handler.
30+ */
31+ public function process (
32+ ServerRequestInterface $ request ,
33+ RequestHandlerInterface $ handler
34+ ): ResponseInterface {
35+ return $ handler ->handle ($ request );
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments