| @@ -1,6 +1,8 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +declare(strict_types=1); | |
| 4 | + | |
| 3 | 5 | namespace Psr\Http\Message; |
| 4 | 6 | |
| 5 | 7 | /** |
| 6 | 8 | * HTTP messages consist of requests from a client to a server and responses |
| @@ -37,9 +39,9 @@ | ||
| 37 | 39 | * |
| 38 | 40 | * @param string $version HTTP protocol version |
| 39 | 41 | * @return static |
| 40 | 42 | */ |
| 41 | - public function withProtocolVersion($version); | |
| 43 | + public function withProtocolVersion(string $version); | |
| 42 | 44 | |
| 43 | 45 | /** |
| 44 | 46 | * Retrieves all message header values. |
| 45 | 47 | * |
| @@ -74,9 +76,9 @@ | ||
| 74 | 76 | * @return bool Returns true if any header names match the given header |
| 75 | 77 | * name using a case-insensitive string comparison. Returns false if |
| 76 | 78 | * no matching header name is found in the message. |
| 77 | 79 | */ |
| 78 | - public function hasHeader($name); | |
| 80 | + public function hasHeader(string $name); | |
| 79 | 81 | |
| 80 | 82 | /** |
| 81 | 83 | * Retrieves a message header value by the given case-insensitive name. |
| 82 | 84 | * |
| @@ -90,9 +92,9 @@ | ||
| 90 | 92 | * @return string[] An array of string values as provided for the given |
| 91 | 93 | * header. If the header does not appear in the message, this method MUST |
| 92 | 94 | * return an empty array. |
| 93 | 95 | */ |
| 94 | - public function getHeader($name); | |
| 96 | + public function getHeader(string $name); | |
| 95 | 97 | |
| 96 | 98 | /** |
| 97 | 99 | * Retrieves a comma-separated string of the values for a single header. |
| 98 | 100 | * |
| @@ -111,9 +113,9 @@ | ||
| 111 | 113 | * @return string A string of values as provided for the given header |
| 112 | 114 | * concatenated together using a comma. If the header does not appear in |
| 113 | 115 | * the message, this method MUST return an empty string. |
| 114 | 116 | */ |
| 115 | - public function getHeaderLine($name); | |
| 117 | + public function getHeaderLine(string $name); | |
| 116 | 118 | |
| 117 | 119 | /** |
| 118 | 120 | * Return an instance with the provided value replacing the specified header. |
| 119 | 121 | * |
| @@ -128,9 +130,9 @@ | ||
| 128 | 130 | * @param string|string[] $value Header value(s). |
| 129 | 131 | * @return static |
| 130 | 132 | * @throws \InvalidArgumentException for invalid header names or values. |
| 131 | 133 | */ |
| 132 | - public function withHeader($name, $value); | |
| 134 | + public function withHeader(string $name, $value); | |
| 133 | 135 | |
| 134 | 136 | /** |
| 135 | 137 | * Return an instance with the specified header appended with the given value. |
| 136 | 138 | * |
| @@ -146,9 +148,9 @@ | ||
| 146 | 148 | * @param string|string[] $value Header value(s). |
| 147 | 149 | * @return static |
| 148 | 150 | * @throws \InvalidArgumentException for invalid header names or values. |
| 149 | 151 | */ |
| 150 | - public function withAddedHeader($name, $value); | |
| 152 | + public function withAddedHeader(string $name, $value); | |
| 151 | 153 | |
| 152 | 154 | /** |
| 153 | 155 | * Return an instance without the specified header. |
| 154 | 156 | * |
| @@ -160,9 +162,9 @@ | ||
| 160 | 162 | * |
| 161 | 163 | * @param string $name Case-insensitive header field name to remove. |
| 162 | 164 | * @return static |
| 163 | 165 | */ |
| 164 | - public function withoutHeader($name); | |
| 166 | + public function withoutHeader(string $name); | |
| 165 | 167 | |
| 166 | 168 | /** |
| 167 | 169 | * Gets the body of the message. |
| 168 | 170 | * |