summaryrefslogtreecommitdiff
path: root/tests/Unit/Middleware/Stub/ReturnResponseMiddleware.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2018-09-04 18:24:11 +0200
committermsquare <msquare@notrademark.de>2018-09-04 18:24:11 +0200
commitb320fc779063ee80b8f0ba505cb323287ccccbf5 (patch)
tree1e420597ae72c979361bf29b66ae7e27c73cf431 /tests/Unit/Middleware/Stub/ReturnResponseMiddleware.php
parent9f1ee0c6c6497d43fb275491ec53fda420f64b81 (diff)
parent36dafdb68acbde2fe42ce36ef50f497c8c06411f (diff)
Merge branch 'MyIgel-rebuild-psr7'
Diffstat (limited to 'tests/Unit/Middleware/Stub/ReturnResponseMiddleware.php')
-rw-r--r--tests/Unit/Middleware/Stub/ReturnResponseMiddleware.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/Unit/Middleware/Stub/ReturnResponseMiddleware.php b/tests/Unit/Middleware/Stub/ReturnResponseMiddleware.php
new file mode 100644
index 00000000..7c241353
--- /dev/null
+++ b/tests/Unit/Middleware/Stub/ReturnResponseMiddleware.php
@@ -0,0 +1,36 @@
+<?php
+
+namespace Engelsystem\Test\Unit\Middleware\Stub;
+
+use Psr\Http\Message\ResponseInterface;
+use Psr\Http\Message\ServerRequestInterface;
+use Psr\Http\Server\MiddlewareInterface;
+use Psr\Http\Server\RequestHandlerInterface;
+
+class ReturnResponseMiddleware implements MiddlewareInterface
+{
+ /** @var ResponseInterface */
+ protected $response;
+
+ public function __construct(ResponseInterface $response)
+ {
+ $this->response = $response;
+ }
+
+ /**
+ * Process an incoming server request and return a response, optionally delegating
+ * response creation to a handler.
+ *
+ * Could be used to group middleware
+ *
+ * @param ServerRequestInterface $request
+ * @param RequestHandlerInterface $handler
+ * @return ResponseInterface
+ */
+ public function process(
+ ServerRequestInterface $request,
+ RequestHandlerInterface $handler
+ ): ResponseInterface {
+ return $this->response;
+ }
+}