@@ -59,18 +59,29 @@ public function getBody(): StreamInterface
59
59
throw new RuntimeException ('Data must be a string value. ' );
60
60
}
61
61
62
+ /**
63
+ * @param string $name
64
+ *
65
+ * @return array<array-key, string>
66
+ */
62
67
public function getHeader ($ name ): array
63
68
{
64
69
$ this ->response = $ this ->formatResponse ();
65
70
return $ this ->response ->getHeader ($ name );
66
71
}
67
72
73
+ /**
74
+ * @param string $name
75
+ */
68
76
public function getHeaderLine ($ name ): string
69
77
{
70
78
$ this ->response = $ this ->formatResponse ();
71
79
return $ this ->response ->getHeaderLine ($ name );
72
80
}
73
81
82
+ /**
83
+ * @return string[][]
84
+ */
74
85
public function getHeaders (): array
75
86
{
76
87
$ this ->response = $ this ->formatResponse ();
@@ -95,12 +106,21 @@ public function getStatusCode(): int
95
106
return $ this ->response ->getStatusCode ();
96
107
}
97
108
109
+ /**
110
+ * @param string $name
111
+ */
98
112
public function hasHeader ($ name ): bool
99
113
{
100
114
$ this ->response = $ this ->formatResponse ();
101
115
return $ this ->response ->hasHeader ($ name );
102
116
}
103
117
118
+ /**
119
+ * @param string $name
120
+ * @param string|string[] $value
121
+ *
122
+ * @return static
123
+ */
104
124
public function withAddedHeader ($ name , $ value ): self
105
125
{
106
126
$ new = clone $ this ;
@@ -109,6 +129,9 @@ public function withAddedHeader($name, $value): self
109
129
return $ new ;
110
130
}
111
131
132
+ /**
133
+ * @return static
134
+ */
112
135
public function withBody (StreamInterface $ body ): self
113
136
{
114
137
$ new = clone $ this ;
@@ -118,6 +141,12 @@ public function withBody(StreamInterface $body): self
118
141
return $ new ;
119
142
}
120
143
144
+ /**
145
+ * @param string $name
146
+ * @param string|string[] $value
147
+ *
148
+ * @return static
149
+ */
121
150
public function withHeader ($ name , $ value ): self
122
151
{
123
152
$ new = clone $ this ;
@@ -126,6 +155,11 @@ public function withHeader($name, $value): self
126
155
return $ new ;
127
156
}
128
157
158
+ /**
159
+ * @param string $name
160
+ *
161
+ * @return static
162
+ */
129
163
public function withoutHeader ($ name ): self
130
164
{
131
165
$ new = clone $ this ;
@@ -134,6 +168,11 @@ public function withoutHeader($name): self
134
168
return $ new ;
135
169
}
136
170
171
+ /**
172
+ * @param string $version
173
+ *
174
+ * @return static
175
+ */
137
176
public function withProtocolVersion ($ version ): self
138
177
{
139
178
$ new = clone $ this ;
@@ -142,6 +181,12 @@ public function withProtocolVersion($version): self
142
181
return $ new ;
143
182
}
144
183
184
+ /**
185
+ * @param int $code
186
+ * @param string $reasonPhrase
187
+ *
188
+ * @return static
189
+ */
145
190
public function withStatus ($ code , $ reasonPhrase = '' ): self
146
191
{
147
192
$ new = clone $ this ;
@@ -150,6 +195,9 @@ public function withStatus($code, $reasonPhrase = ''): self
150
195
return $ new ;
151
196
}
152
197
198
+ /**
199
+ * @return static
200
+ */
153
201
public function withResponseFormatter (DataResponseFormatterInterface $ responseFormatter ): self
154
202
{
155
203
$ new = clone $ this ;
@@ -159,6 +207,9 @@ public function withResponseFormatter(DataResponseFormatterInterface $responseFo
159
207
return $ new ;
160
208
}
161
209
210
+ /**
211
+ * @return static
212
+ */
162
213
public function withData ($ data ): self
163
214
{
164
215
$ new = clone $ this ;
0 commit comments