Skip to content

Commit 34c35f6

Browse files
authored
Add eventStream signature to ResponseFactory contract (#56306)
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.
1 parent c680677 commit 34c35f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Illuminate/Contracts/Routing/ResponseFactory.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ public function json($data = [], $status = 200, array $headers = [], $options =
5757
*/
5858
public function jsonp($callback, $data = [], $status = 200, array $headers = [], $options = 0);
5959

60+
/**
61+
* Create a new event stream response.
62+
*
63+
* @param \Closure $callback
64+
* @param array $headers
65+
* @param \Illuminate\Http\StreamedEvent|string|null $endStreamWith
66+
* @return \Symfony\Component\HttpFoundation\StreamedResponse
67+
*/
68+
public function eventStream($callback, array $headers = [], $endStreamWith = '</stream>');
69+
6070
/**
6171
* Create a new streamed response instance.
6272
*

0 commit comments

Comments
 (0)