| @@ -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 | * Describes a data stream. |
| @@ -83,9 +85,9 @@ | ||
| 83 | 85 | * offset bytes SEEK_CUR: Set position to current location plus offset |
| 84 | 86 | * SEEK_END: Set position to end-of-stream plus offset. |
| 85 | 87 | * @throws \RuntimeException on failure. |
| 86 | 88 | */ |
| 87 | - public function seek($offset, $whence = SEEK_SET); | |
| 89 | + public function seek(int $offset, int $whence = SEEK_SET); | |
| 88 | 90 | |
| 89 | 91 | /** |
| 90 | 92 | * Seek to the beginning of the stream. |
| 91 | 93 | * |
| @@ -111,9 +113,9 @@ | ||
| 111 | 113 | * @param string $string The string that is to be written. |
| 112 | 114 | * @return int Returns the number of bytes written to the stream. |
| 113 | 115 | * @throws \RuntimeException on failure. |
| 114 | 116 | */ |
| 115 | - public function write($string); | |
| 117 | + public function write(string $string); | |
| 116 | 118 | |
| 117 | 119 | /** |
| 118 | 120 | * Returns whether or not the stream is readable. |
| 119 | 121 | * |
| @@ -130,9 +132,9 @@ | ||
| 130 | 132 | * @return string Returns the data read from the stream, or an empty string |
| 131 | 133 | * if no bytes are available. |
| 132 | 134 | * @throws \RuntimeException if an error occurs. |
| 133 | 135 | */ |
| 134 | - public function read($length); | |
| 136 | + public function read(int $length); | |
| 135 | 137 | |
| 136 | 138 | /** |
| 137 | 139 | * Returns the remaining contents in a string |
| 138 | 140 | * |
| @@ -148,11 +150,11 @@ | ||
| 148 | 150 | * The keys returned are identical to the keys returned from PHP's |
| 149 | 151 | * stream_get_meta_data() function. |
| 150 | 152 | * |
| 151 | 153 | * @link http://php.net/manual/en/function.stream-get-meta-data.php |
| 152 | - * @param string $key Specific metadata to retrieve. | |
| 154 | + * @param string|null $key Specific metadata to retrieve. | |
| 153 | 155 | * @return array|mixed|null Returns an associative array if no key is |
| 154 | 156 | * provided. Returns a specific key value if a key is provided and the |
| 155 | 157 | * value is found, or null if the key is not found. |
| 156 | 158 | */ |
| 157 | - public function getMetadata($key = null); | |
| 159 | + public function getMetadata(?string $key = null); | |
| 158 | 160 | } |