This repository was archived by the owner on May 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +43
-21
lines changed Expand file tree Collapse file tree 3 files changed +43
-21
lines changed Original file line number Diff line number Diff line change 1
1
# Change Log
2
2
3
+ ## UNRELEASED
4
+
5
+ ### Added
6
+
7
+ - Response Factory in order to be reused in Message and Server Message factories
8
+
9
+
3
10
## 1.0.0-rc1 - 2015-12-14
4
11
5
12
### Added
Original file line number Diff line number Diff line change 4
4
5
5
use Psr \Http \Message \UriInterface ;
6
6
use Psr \Http \Message \RequestInterface ;
7
- use Psr \Http \Message \ResponseInterface ;
8
7
use Psr \Http \Message \StreamInterface ;
9
8
10
9
/**
11
10
* Factory for PSR-7 Request and Response.
12
11
*
13
12
* @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
14
13
*/
15
- interface MessageFactory
14
+ interface MessageFactory extends ResponseFactory
16
15
{
17
16
/**
18
17
* Creates a new PSR-7 request.
@@ -32,23 +31,4 @@ public function createRequest(
32
31
$ body = null ,
33
32
$ protocolVersion = '1.1 '
34
33
);
35
-
36
- /**
37
- * Creates a new PSR-7 response.
38
- *
39
- * @param int $statusCode
40
- * @param string|null $reasonPhrase
41
- * @param array $headers
42
- * @param resource|string|StreamInterface|null $body
43
- * @param string $protocolVersion
44
- *
45
- * @return ResponseInterface
46
- */
47
- public function createResponse (
48
- $ statusCode = 200 ,
49
- $ reasonPhrase = null ,
50
- array $ headers = [],
51
- $ body = null ,
52
- $ protocolVersion = '1.1 '
53
- );
54
34
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Http \Message ;
4
+
5
+ use Psr \Http \Message \ResponseInterface ;
6
+ use Psr \Http \Message \StreamInterface ;
7
+
8
+ /**
9
+ * Factory for PSR-7 Response.
10
+ *
11
+ * This factory contract can be reused in Message and Server Message factories.
12
+ *
13
+ * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
14
+ */
15
+ interface ResponseFactory
16
+ {
17
+ /**
18
+ * Creates a new PSR-7 response.
19
+ *
20
+ * @param int $statusCode
21
+ * @param string|null $reasonPhrase
22
+ * @param array $headers
23
+ * @param resource|string|StreamInterface|null $body
24
+ * @param string $protocolVersion
25
+ *
26
+ * @return ResponseInterface
27
+ */
28
+ public function createResponse (
29
+ $ statusCode = 200 ,
30
+ $ reasonPhrase = null ,
31
+ array $ headers = [],
32
+ $ body = null ,
33
+ $ protocolVersion = '1.1 '
34
+ );
35
+ }
You can’t perform that action at this time.
0 commit comments