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

[6.x] Handle passing too many arguments to @slot #30893

Merged
merged 2 commits into from Dec 23, 2019
Merged

[6.x] Handle passing too many arguments to @slot #30893

merged 2 commits into from Dec 23, 2019

Conversation

browner12
Copy link
Contributor

Problem

Passing too many arguments to a @slot directive will start an output buffer without closing it.

This can cause the cryptic "Test code or tested code did not (only) close its own output buffers" error message.

Solution

This PR checks to see if more than 2 parameters have been passed to the @slot, and throws an Exception with an explanation of the issue.

add an extra conditional if the number of arguments is greater than 2, and throw an exception telling the user they've passed too many arguments to the `@slot`.

also simplify an "else if" to an "elseif"
@GrahamCampbell GrahamCampbell changed the title [6.x] handle passing too many arguments to a @slot [6.x] Handle passing too many arguments to @slot Dec 20, 2019
@taylorotwell taylorotwell merged commit 8e414a1 into laravel:6.x Dec 23, 2019
@browner12 browner12 deleted the slot-args branch December 23, 2019 16:15
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.

None yet

2 participants