PHP-Var-Dump-Check
PHP-Var-Dump-Check copied to clipboard
Add --custom-function parameter to check
trafficstars
In one of the projects that I have been working for a while, there are some legacy dump functions created and used frequently by the team. A sample function is;
function pre_dump( $var ) { echo '<pre>'; var_dump( $var ); echo '</pre>'; }
The check can not be able to find the usage of such kind of functions. A sample usage might be;
$ ./vendor/bin/var-dump-check --no-colors --tracy --custom-function pre_dump,echo_dump .
I have created a pull request for this case.
This would be really helpful. I often write a little custom function myself like
function pretty_dump($var) {
echo "<pre>" . json_encode($var, JSON_PRETTY_PRINT) . "</pre>";
}
It'd be handy to be able to check for something like that.