Skip to content

fix bug for always throwing exception when we pass a callable to throwUnlessStatus method [test included]#48844

Merged
taylorotwell merged 2 commits into
laravel:10.xfrom
moferry96:10.x
Oct 30, 2023
Merged

fix bug for always throwing exception when we pass a callable to throwUnlessStatus method [test included]#48844
taylorotwell merged 2 commits into
laravel:10.xfrom
moferry96:10.x

Conversation

@moferry96

Copy link
Copy Markdown
Contributor

In the current code if the $statusCode is callable and it returns true we correctly do not throw an exception in the if statement but in the ternary condition since $statusCode is callable and $this->status() returns an integer we throw an exception anyway.
This pull request tries to address this problem.

@taylorotwell taylorotwell merged commit c55667a into laravel:10.x Oct 30, 2023
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.

2 participants