This commit is contained in:
2023-10-24 17:22:29 +08:00
parent 982e9d66bc
commit 115d228158
9 changed files with 14 additions and 15 deletions
+7 -6
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace Kiri\Router\Constrict;
use Psr\Http\Message\StreamInterface;
use RuntimeException;
class Stream implements StreamInterface
{
@@ -93,7 +94,7 @@ class Stream implements StreamInterface
* Returns the current position of the file read/write pointer
*
* @return int Position of the file pointer
* @throws \RuntimeException on error.
* @throws RuntimeException on error.
*/
public function tell(): int
{
@@ -133,7 +134,7 @@ class Stream implements StreamInterface
* PHP $whence values for `fseek()`. SEEK_SET: Set position equal to
* offset bytes SEEK_CUR: Set position to current location plus offset
* SEEK_END: Set position to end-of-stream plus offset.
* @throws \RuntimeException on failure.
* @throws RuntimeException on failure.
*/
public function seek(int $offset, int $whence = SEEK_SET): void
{
@@ -149,7 +150,7 @@ class Stream implements StreamInterface
* If the stream is not seekable, this method will raise an exception;
* otherwise, it will perform a seek(0).
*
* @throws \RuntimeException on failure.
* @throws RuntimeException on failure.
* @link http://www.php.net/manual/en/function.fseek.php
* @see seek()
*/
@@ -178,7 +179,7 @@ class Stream implements StreamInterface
*
* @param string $string The string that is to be written.
* @return int Returns the number of bytes written to the stream.
* @throws \RuntimeException on failure.
* @throws RuntimeException on failure.
*/
public function write(string $string): int
{
@@ -215,7 +216,7 @@ class Stream implements StreamInterface
* call returns fewer bytes.
* @return string Returns the data read from the stream, or an empty string
* if no bytes are available.
* @throws \RuntimeException if an error occurs.
* @throws RuntimeException if an error occurs.
*/
public function read(int $length): string
{
@@ -231,7 +232,7 @@ class Stream implements StreamInterface
* Returns the remaining contents in a string
*
* @return string
* @throws \RuntimeException if unable to read or an error occurs while
* @throws RuntimeException if unable to read or an error occurs while
* reading.
*/
public function getContents(): string