PHP-Var-Dump-Check icon indicating copy to clipboard operation
PHP-Var-Dump-Check copied to clipboard

Add --custom-function parameter to check

Open umutphp opened this issue 6 years ago • 1 comments
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.

https://github.com/JakubOnderka/PHP-Var-Dump-Check/pull/32

umutphp avatar Dec 13 '18 11:12 umutphp

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.

AlgyTaylor avatar Apr 02 '19 12:04 AlgyTaylor