Skip to content
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

[5.7] Fix for EventFake not returning responses #27430

Merged
merged 2 commits into from
Feb 7, 2019
Merged

[5.7] Fix for EventFake not returning responses #27430

merged 2 commits into from
Feb 7, 2019

Conversation

jasonvarga
Copy link
Contributor

We're relying on the responses returned from the dispatcher, but when using the EventFake, nothing gets returned at all. Looks like a simple return was left off.

Not sure how far back this PR should go. Docs say bug fixes should go back to the LTS but this class doesn't exist in 5.5.

@@ -211,7 +211,7 @@ public function dispatch($event, $payload = [], $halt = false)
if ($this->shouldFakeEvent($name, $payload)) {
$this->events[$name][] = func_get_args();
} else {
$this->dispatcher->dispatch($event, $payload, $halt);
return $this->dispatcher->dispatch($event, $payload, $halt);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not an early return?

if ($this->shouldFakeEvent($name, $payload) === false) {
    return $this->dispatcher->dispatch($event, $payload, $halt);
}

$this->events[$name][] = func_get_args();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to make as small a change as possible.

@driesvints driesvints changed the title Fix for EventFake not returning responses [5.7] Fix for EventFake not returning responses Feb 7, 2019
@taylorotwell taylorotwell merged commit aadf70a into laravel:5.7 Feb 7, 2019
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