Skip to content

Implement LogStream fallback mechanism and add unit tests.#2

Merged
gustavofreze merged 2 commits intomainfrom
fix/stream
Feb 24, 2026
Merged

Implement LogStream fallback mechanism and add unit tests.#2
gustavofreze merged 2 commits intomainfrom
fix/stream

Conversation

@gustavofreze
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings February 24, 2026 05:04
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efa9fb12f7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements a fallback mechanism for the LogStream class when no resource is provided, and adds unit tests to verify the behavior. However, the implementation changes the fallback from STDERR (a standard error stream) to php://memory (an in-memory buffer), which fundamentally breaks the logger's documented behavior.

Changes:

  • Modified LogStream::from() to use php://memory as fallback instead of STDERR constant
  • Added unit tests for LogStream covering custom resource and null fallback scenarios

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/Internal/Stream/LogStream.php Changes fallback behavior from STDERR to php://memory when no resource provided
tests/Internal/Stream/LogStreamTest.php Adds new test file with two test cases for LogStream functionality

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gustavofreze gustavofreze merged commit 3bd6e1d into main Feb 24, 2026
5 checks passed
@gustavofreze gustavofreze deleted the fix/stream branch February 25, 2026 03:46
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.

2 participants