-
-
Notifications
You must be signed in to change notification settings - Fork 359
[Turbo] add options to EventSource Mercure #1774
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,8 @@ | |
interface TurboStreamListenRendererInterface | ||
{ | ||
/** | ||
* @param string|object $topic | ||
* @param string|object $topic | ||
* @param array<string,mixed> $eventSourceOptions | ||
*/ | ||
public function renderTurboStreamListen(Environment $env, $topic): string; | ||
public function renderTurboStreamListen(Environment $env, $topic, array $eventSourceOptions = []): string; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You cannot add parameter on an interface, even with default values, without breaking existing implementation. interface FooInterface
{
public function bar(string $a, array $eventSourceOptions = []): string;
}
class AppFoo implements FooInterface
{
// existing method matching previous interface
public function bar(string $a): string
{
return $a;
}
} This throws a PHP Fatal error as a the concrete implementation is not compatible anymore (see here).
So to make this change in a BC way, you need:
You can see here a recent example of Symfony PR with similar BC layer: symfony/symfony#54531 Poke me if you need a hand here! |
||
} |
Uh oh!
There was an error while loading. Please reload this page.