Skip to content

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.

$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