File tree Expand file tree Collapse file tree 4 files changed +32
-23
lines changed Expand file tree Collapse file tree 4 files changed +32
-23
lines changed Original file line number Diff line number Diff line change 23
23
},
24
24
"autoload" : {
25
25
"psr-4" : {
26
- "Interop\\ Http\\ ServerMiddleware \\ " : " src/"
26
+ "Interop\\ Http\\ Server \\ " : " src/"
27
27
}
28
28
},
29
29
"extra" : {
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- namespace Interop \Http \ServerMiddleware ;
3
+ namespace Interop \Http \Server ;
4
4
5
5
use Psr \Http \Message \ResponseInterface ;
6
6
use Psr \Http \Message \ServerRequestInterface ;
7
7
8
+ /**
9
+ * An HTTP middleware component participates in processing an HTTP message,
10
+ * either by acting on the request or the response. This interface defines the
11
+ * methods required to use the middleware.
12
+ */
8
13
interface MiddlewareInterface
9
14
{
10
15
/**
11
16
* Process an incoming server request and return a response, optionally delegating
12
- * to the next middleware component to create the response .
17
+ * response creation to a handler .
13
18
*
14
19
* @param ServerRequestInterface $request
15
- * @param DelegateInterface $delegate
20
+ * @param RequestHandlerInterface $handler
16
21
*
17
22
* @return ResponseInterface
18
23
*/
19
- public function process (ServerRequestInterface $ request , DelegateInterface $ delegate );
24
+ public function process (ServerRequestInterface $ request , RequestHandlerInterface $ handler );
20
25
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Interop \Http \Server ;
4
+
5
+ use Psr \Http \Message \ResponseInterface ;
6
+ use Psr \Http \Message \ServerRequestInterface ;
7
+
8
+ /**
9
+ * An HTTP request handler process a HTTP request and produces an HTTP response.
10
+ * This interface defines the methods require to use the request handler.
11
+ */
12
+ interface RequestHandlerInterface
13
+ {
14
+ /**
15
+ * Handle the request and return a response.
16
+ *
17
+ * @param ServerRequestInterface $request
18
+ *
19
+ * @return ResponseInterface
20
+ */
21
+ public function handle (ServerRequestInterface $ request );
22
+ }
You can’t perform that action at this time.
0 commit comments