Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I've let a call to dpm()
slip into my commits a few times. I once saw a contributed module release that contained one. Obviously that's bad since debugging functions will needlessly consume resources and potentially leak information on a live site if Devel is installed and will cause a fatal PHP error if it isn't. Maybe Coder could check for the presence of such function calls. I know Devel provides at least these:
dargs()
dcp()
dd()
dfb()
dfbt()
dpm()
dpq()
dpr()
dprint_r()
drupal_debug()
dsm()
dvm()
dvr()
kdevel_print_object()
kpr()
kprint_r()
Comment | File | Size | Author |
---|---|---|---|
#3 | 1874468-Adding-DiscouragedFunctionsSniff-3.patch | 2.83 KB | TravisCarden |
#2 | 1874468-Adding-DiscouragedFunctionsSniff.patch | 2.14 KB | dstol |
Comments
Comment #1
TravisCarden CreditAttribution: TravisCarden commentedComment #2
dstolComment #3
TravisCarden CreditAttribution: TravisCarden commentedThanks, @dstol! That works great. Here's an updated version of the patch that observes the standards laid out in the contribution guidelines.
Comment #4
klausiCommited, thanks! http://drupalcode.org/project/coder.git/commit/2446cdc
Ugly that we have to implement a class and cannot specify this from ruleset.xml.