Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[VarDumper] Add dd() helper == dump() + exit()#26970
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
javiereguiluz left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We gave some reasons to not add this function in the past ... but when you receive so many requests from the community to add it, it's time to rethink your decisions. Nicolas, thanks for reconsidering this and for adding the function.
onEXHovia commentedApr 18, 2018
I think there will be a similar number of pros and cons. |
pamil commentedApr 18, 2018
Seeing |
linaori commentedApr 18, 2018
I see no downsides and maintenance isn't an issue 👍 |
kunicmarko20 commentedApr 18, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
lsmith77 left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think the potential for harm is very small and the feature has been requested a lot.
lyrixx left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍
Pierstoval commentedApr 18, 2018
Creating a macro in the IDE is part of the doc, not the framework, and not asked as much as |
stof left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
SourceContextProvider must be updated to whitelistdd as well when looking for the source of the dump. Otherwise, the dump will be reported as coming from insidedd which is useless.
linaori commentedApr 18, 2018
@kunicmarko20 Not everyone is always developing with an IDE, don't forget the notepad(++), Vim, atom etc developers. Also important to note down, is that the var-dumper can be used as stand-alone. Meaning if devs like the symfony When you're comparing the full feature set of the var-dumper component vs other dumpers, then a dump and die functionality is quite common and desired. It takes a few lines to add the function, but adds a big feeling of completion for the developers that would otherwise have used a I think it's quite nice to have a "full" solution coming from Symfony, making it even better 👍 |
pamil commentedApr 18, 2018
After reading the reasoning behind introducing this function I think it's a good idea in fact and with almost no potential for harm. 👍 |
deflock commentedApr 18, 2018
The feature itself is must have, but not sure about name, confuses a bit. @iltar Can you explain "It's optional"? What if I want |
Meroje commentedApr 18, 2018
@nicolas-grekas @DojoGeekRA chrome 65 removed the need for an error code to render the preview that was introduced with 62https://bugs.chromium.org/p/chromium/issues/detail?id=785050 |
haydenk commentedApr 18, 2018
Why not add an optional argument to |
lyrixx commentedApr 18, 2018
because dump is variadic |
haydenk commentedApr 18, 2018
@lyrixx Ah, good point. |
joubertredrat commentedApr 18, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Oh, a enem..., erm, a friend@taylorotwell here? Hey, let's drink coffee? About function, I think that is best to be more verbosity, how
Because |
kunicmarko20 commentedApr 18, 2018
If people think we need a shortcut then it should be small, |
Pierstoval commentedApr 18, 2018
What a mess of a conversation just for a DX initiative that has been demanded for a long time, and still lots of arguments against. I think this is part of the small changes that can really conciliate lots of dev communities and improve "classic" debug experience as well for people not using complex xdebug setups or full-stack IDEs. I mean, when one debugs using VIM, a simple |
akalongman commentedApr 18, 2018
+1 for |
Majkl578 commentedApr 18, 2018
Maybe rename |
carusogabriel left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
🍿
antoniocambados commentedApr 18, 2018
I don't miss a |
fabpot commentedApr 19, 2018
Thank you@nicolas-grekas. |
…s-grekas)This PR was merged into the 4.1-dev branch.Discussion----------[VarDumper] Add dd() helper == dump() + exit()| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | -| License | MIT| Doc PR | -By popular demand, I feel like we should reconsider our refusal for a `dd()` global helper.For past references, see#26965,#26906,#13657,#17267,#19096.Commits-------a55916a [VarDumper] Add dd() helper == dump() + die()
Wirone commentedApr 19, 2018
Unless they're in command mode 😂 |
sstok commentedApr 19, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Lets be clear, a function/method/class should always have a name that describes it's purpose, it helps the developers and prevents mistakes. dd, a or Foobar are not descriptive (unless you have a Bar named foo Clean Code is about production code and tests, not about simple hacks to find out why something isn't working. Not everyone has the power of a debugger, sometimes the debugger is not able to reach the code (actually happened to me a few time) or doesn't show all details (or the details are to verbose), by using the VarDumper you can easily solve this problem, and having a simple method to dump and prevent further execution is perfectly fine for development and troubleshooting. |
gragio commentedApr 19, 2018
Good job! Thanks@nicolas-grekas |
jpauli commentedApr 19, 2018
👍 |
nicolas-grekas commentedApr 19, 2018
I'm locking the thread because the issue has been resolved. |
By popular demand, I feel like we should reconsider our refusal for a
dd()global helper.For past references, see#26965,#26906,#13657,#17267,#19096.