@@ -25,7 +25,7 @@ interface MessageInterface
2525 *
2626 * @return string HTTP protocol version.
2727 */
28- public function getProtocolVersion ();
28+ public function getProtocolVersion (): string ;
2929
3030 /**
3131 * Return an instance with the specified HTTP protocol version.
@@ -40,7 +40,7 @@ public function getProtocolVersion();
4040 * @param string $version HTTP protocol version
4141 * @return static
4242 */
43- public function withProtocolVersion (string $ version );
43+ public function withProtocolVersion (string $ version ): MessageInterface ;
4444
4545 /**
4646 * Retrieves all message header values.
@@ -67,7 +67,7 @@ public function withProtocolVersion(string $version);
6767 * key MUST be a header name, and each value MUST be an array of strings
6868 * for that header.
6969 */
70- public function getHeaders ();
70+ public function getHeaders (): array ;
7171
7272 /**
7373 * Checks if a header exists by the given case-insensitive name.
@@ -77,7 +77,7 @@ public function getHeaders();
7777 * name using a case-insensitive string comparison. Returns false if
7878 * no matching header name is found in the message.
7979 */
80- public function hasHeader (string $ name );
80+ public function hasHeader (string $ name ): bool ;
8181
8282 /**
8383 * Retrieves a message header value by the given case-insensitive name.
@@ -93,7 +93,7 @@ public function hasHeader(string $name);
9393 * header. If the header does not appear in the message, this method MUST
9494 * return an empty array.
9595 */
96- public function getHeader (string $ name );
96+ public function getHeader (string $ name ): array ;
9797
9898 /**
9999 * Retrieves a comma-separated string of the values for a single header.
@@ -114,7 +114,7 @@ public function getHeader(string $name);
114114 * concatenated together using a comma. If the header does not appear in
115115 * the message, this method MUST return an empty string.
116116 */
117- public function getHeaderLine (string $ name );
117+ public function getHeaderLine (string $ name ): string ;
118118
119119 /**
120120 * Return an instance with the provided value replacing the specified header.
@@ -131,7 +131,7 @@ public function getHeaderLine(string $name);
131131 * @return static
132132 * @throws \InvalidArgumentException for invalid header names or values.
133133 */
134- public function withHeader (string $ name , $ value );
134+ public function withHeader (string $ name , $ value ): MessageInterface ;
135135
136136 /**
137137 * Return an instance with the specified header appended with the given value.
@@ -149,7 +149,7 @@ public function withHeader(string $name, $value);
149149 * @return static
150150 * @throws \InvalidArgumentException for invalid header names or values.
151151 */
152- public function withAddedHeader (string $ name , $ value );
152+ public function withAddedHeader (string $ name , $ value ): MessageInterface ;
153153
154154 /**
155155 * Return an instance without the specified header.
@@ -163,14 +163,14 @@ public function withAddedHeader(string $name, $value);
163163 * @param string $name Case-insensitive header field name to remove.
164164 * @return static
165165 */
166- public function withoutHeader (string $ name );
166+ public function withoutHeader (string $ name ): MessageInterface ;
167167
168168 /**
169169 * Gets the body of the message.
170170 *
171171 * @return StreamInterface Returns the body as a stream.
172172 */
173- public function getBody ();
173+ public function getBody (): StreamInterface ;
174174
175175 /**
176176 * Return an instance with the specified message body.
@@ -185,5 +185,5 @@ public function getBody();
185185 * @return static
186186 * @throws \InvalidArgumentException When the body is not valid.
187187 */
188- public function withBody (StreamInterface $ body );
188+ public function withBody (StreamInterface $ body ): MessageInterface ;
189189}
0 commit comments