Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve type docblocks #1

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/ResourceStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function unwrap(): mixed
*
* @throws RuntimeException
*
* @return self
* @return self<resource>
*/
public function apply(\Closure $closure): self
{
Expand Down Expand Up @@ -105,6 +105,8 @@ public function uri(): ?string

/**
* @throws RuntimeException
*
* @return self<resource>
*/
public function rewind(): self
{
Expand All @@ -122,6 +124,8 @@ public function rewind(): self
* @param ResourceStream<resource> $targetStream
*
* @throws RuntimeException
*
* @return ResourceStream<resource>
*/
public function copyTo(ResourceStream $targetStream, ?int $length = null, int $offset = 0): ResourceStream
{
Expand All @@ -140,6 +144,8 @@ public function copyTo(ResourceStream $targetStream, ?int $length = null, int $o
* @param ResourceStream<resource> $sourceStream
*
* @throws RuntimeException
*
* @return self<resource>
*/
public function copyFrom(ResourceStream $sourceStream, ?int $length = null, int $offset = 0): self
{
Expand Down Expand Up @@ -246,6 +252,8 @@ public function readBatches(int $length = self::DEFAULT_BUFFER_SIZE): \Generator

/**
* @throws RuntimeException
*
* @return self<resource>
*/
public function write(string $data): self
{
Expand Down