Skip to content

Correct stream caching, write permissions, and position tracking - #1389

Merged
asika32764 merged 2 commits into
masterfrom
copilot/fix-stream-issues
Nov 8, 2026
Merged

asika32764 merged 2 commits into
masterfrom
copilot/fix-stream-issues

Conversation

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Several stream behaviors were inconsistent: the PHP input stream was not cached, StringStream ignored write restrictions and did not advance after reading its remaining contents, and a null decorator target left its inner stream uninitialized.

  • Caching: Reuse the PhpInputStream instance returned by getInstance().
  • String streams: Reject writes when not writable and advance the position after getContents().
  • Decorator streams: Initialize a missing target with an empty Stream.
  • Regression coverage: Add tests for singleton reuse, blocked writes, position advancement, and the default decorator target.
$stream = new StringStream('FOO');
$stream->getContents();

$stream->tell(); // 3

Copilot AI linked an issue Nov 7, 2026 that may be closed by this pull request
Co-authored-by: asika32764 <1639206+asika32764@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix stream issues in PhpInputStream and StringStream Correct stream caching, write permissions, and position tracking Nov 7, 2026
Copilot AI requested a review from asika32764 November 7, 2026 17:46
@asika32764
asika32764 marked this pull request as ready for review November 8, 2026 04:01
@asika32764
asika32764 merged commit c04274d into master Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream Issues

2 participants