kint-php / kint

Kint - Advanced PHP dumper
https://kint-php.github.io/kint/
MIT License
2.77k stars 291 forks source link

Document removal of dd, ddd, sd #236

Closed sabas closed 7 years ago

sabas commented 7 years ago

Hi, I've upgraded to 2.0 and it seems to have lost the ddd alias (dump + die). Originally introduced here https://github.com/kint-php/kint/commit/36cf9e60ef4279e75f24c21ee1ffe385f7fedf45

There's any particular reason for this? Thanks!

jnvsor commented 7 years ago

Yes - the dd, ddd, sd aliases were removed because they pollute the global namespace for some really simple functionality.

Also, if the last version you were using was 1.0 you may not have noticed the aliasing system. If you want ddd() back you can implement it yourself in a few lines:

function ddd(...$v){
  d(...$v);
  exit;
}
Kint::$aliases[] = 'ddd';
sabas commented 7 years ago

Thank you very much!

marcus-at-localhost commented 7 years ago

Please mention somewhere prominent what you removed and what is deprecated. There is not even a changelog. (or I am blind, then I apologize) I installed Kint as always and expected it to work with ddd() and then went through commit history, trying to understand what happened until I finally found this issue here. Thanks though for all the improvements. Plugins looking promising.

jnvsor commented 7 years ago

You're right. I should document it. Since 2.0 all deprecations trigger an E_USER_DEPRECATED messages telling you to stay away from deprecated functionality.

jnvsor commented 7 years ago

Done

vesper8 commented 7 years ago

What is the best way of re-adding ddd in Laravel specifically ?

function ddd(...$v){
  d(...$v);
  exit;
}
Kint::$aliases[] = 'ddd';

Where do I put this? I tried putting it in a custom service provider's boot method. I can add it to the aliases but then it doesn't know where the ddd function actually is