psalm-plugin-symfony icon indicating copy to clipboard operation
psalm-plugin-symfony copied to clipboard

Report dd() and dump() methods

Open loevgaard opened this issue 4 years ago • 2 comments

Would it make sense to emit an error when seeing a dd() or dump()?

I do this myself using a PHPStan extension, but just wanted to pitch the idea here because I think it makes sense

loevgaard avatar Mar 12 '21 08:03 loevgaard

@loevgaard thank you for the idea.

In my projects, I use it configuring psalm.xml

<?xml version="1.0"?>
<psalm>
    <forbiddenFunctions>
        <function name="dd"/>
        <function name="dump"/>
    </forbiddenFunctions>
</psalm>

The plugin may do this automatically or we can add reminder documentation about forbiddenFunctions feature of Psalm

seferov avatar Mar 12 '21 08:03 seferov

Oh, that's an easy fix also. Didn't even know that. I am just beginning Psalm :)

I think it would make sense that the plugin did this automatically. Given the insight I have into Psalm plugins (zero) I guess I would need some help to create a PR. Maybe you know of other plugins adding 'forbidden functions'?

loevgaard avatar Mar 12 '21 08:03 loevgaard