I’m using git (and I develop in PHP) and I have a tendency to commit debug code like print_r, var_dump, and die – I was wondering if I could somehow have git warn me that those functions are being called (so I don’t end up pushing them to master).
I’m using git (and I develop in PHP) and I have a tendency to
Share
First of all, stop using those functions! You should really be using XDebug which lets you step through your code, stop it at any point and see all of the variables that are available, etc.
However, even if you do continue to use them (I use them still, even though I use XDebug for a lot of debugging) you should look into git hooks.