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

[5.7] Remove dd() helper #25087

Merged
merged 2 commits into from
Aug 5, 2018
Merged

Conversation

tillkruss
Copy link
Contributor

Followup from #25086.

@tillkruss tillkruss changed the title [5.7] Remove dd helper [5.7] Remove dd() helper Aug 4, 2018
@GrahamCampbell
Copy link
Member

👍

@taylorotwell taylorotwell merged commit df7810a into laravel:5.7 Aug 5, 2018
nicolas-grekas added a commit to symfony/symfony that referenced this pull request Sep 21, 2018
…(SjorsO)

This PR was merged into the 4.2-dev branch.

Discussion
----------

[VarDumper] Allow dd() to be called without arguments

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

**Description**
A while back the `dd()` helper was [added to the VarDumper component](#26970) which was (i think) inspired by Laravel's `dd()` helper. Laravel has [removed their version of the helper](laravel/framework#25087) in favor of the helper in Symfony.

However, as opposed to the Laravel helper, the Symfony helper requires at least one argument. Calling the Laravel helper with no arguments simply killed the program (and usually showed a white screen), calling the Symfony helper with no arguments throws a `TypeError: Too few arguments to function dd()` exception (which gets rendered by the error handler and fills the whole screen with useless information).

Being able to call the `dd()` helper with no arguments is useful because it is a quick way to tell you if your code reaches a certain point. If it does, you can fill in the `dd()` with variables to keep debugging.

This PR allows the dd helper to be called without arguments.

This PR also makes the helper call `die` instead of `exit` to better reflect the function name 😄

Commits
-------

a73dfad [VarDumper] Allow dd() to be called without arguments
datune added a commit to datune/october that referenced this pull request Mar 24, 2020
LukeTowers pushed a commit to octobercms/october that referenced this pull request Mar 24, 2020
LukeTowers pushed a commit to octoberrain/cms that referenced this pull request Mar 31, 2020
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