Skip to content

Add eventStream signature to ResponseFactory contract #56306

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

Merged
merged 1 commit into from
Jul 18, 2025

Conversation

csfh
Copy link

@csfh csfh commented Jul 15, 2025

Commit description

Adds eventStream to Illuminate\Contracts\Routing\ResponseFactory in order to add type support for this method, aligning this with the same behavior that we have for stream of which eventStream is a convenient wrapper.

Why this change

At this time the ResponseFactory contract does not include a signature for the eventStream method. However, the function does exist on the underlying concrete implementation returned by the response() helper.

Not having this included can cause some false positive warnings and errors when statically analyzing a codebase using the eventStream function, such as when using intellisense in VS Code. Additionally, this can throw off AI agents from using the method, even if directly instructed to (tested using Claude Sonnet 4).

The method is already described on the Response facade–this PR would align the response helper with the facade.

This is a additive feature and does not introduce breaking changes.

Of note:

I do not see any existing tests for eventStream, but here is additionally PRs for context on the function.

Copy link

Thanks for submitting a PR!

Note that draft PR's are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

Adds `eventStream` to `Illuminate\Contracts\Routing\ResponseFactory` in order to add type support for this method, aligning this with the same behavior that we have for `stream` of which `eventStream` is a convenient wrapper.
@csfh csfh changed the base branch from 12.x to master July 16, 2025 21:49
@csfh csfh marked this pull request as ready for review July 16, 2025 21:50
@csfh csfh requested a review from crynobone July 16, 2025 21:50
@taylorotwell taylorotwell merged commit 34c35f6 into laravel:master Jul 18, 2025
1 check passed
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.

3 participants