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 2 commits into from Dec 23, 2019


Copy link

browner12 commented Dec 20, 2019


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.


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.

browner12 added 2 commits Dec 20, 2019
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
2 checks passed
2 checks passed
continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed
@browner12 browner12 deleted the browner12:slot-args branch Dec 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.