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

[8.x] Fix request dump and dd methods #39931

Merged
merged 2 commits into from
Dec 8, 2021

Conversation

seriquynh
Copy link
Contributor

What do I do?

  1. I fix the dump docblock because it doesn't only accept array as parameters but also an argument list. These two calls produce the same result.
// it takes an array.
$request->dump(['name', 'age']);

// it takes an argument list.
$request->dump('name', 'age');
  1. Because dd method uses ... oparator, $keys in this context will be always an array and the check is unnecessary. dd just need to forward the call to dump and then to end the script.
class Request
{
    public function dd(...$keys)
    {
        $this->dump(...$keys);

        exit(1);
    }
}

@taylorotwell taylorotwell merged commit 57311eb into laravel:8.x Dec 8, 2021
@seriquynh seriquynh deleted the fix-request-dump-and-dd branch December 8, 2021 13:17
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