In my newest module for Drupal I've been using the new DateTime objects in PHP 5.2 and the methods for these objects use camelCase. Coder reports this even though there is nothing wrong with my code. I suggest ignoring camelCased methods since there's no object-oriented features in Drupal right now, so any method like that would probably be a PHP built-in.

Comments

douggreen’s picture

Good suggestion! The rule is on line 212 of includes/coder_style.inc. If you come up with the appropriate backtrace exclusion, please submit a patch. I tried quite a few and couldn't figure it out.

Susurrus’s picture

I think that any CamelCased method used in Drupal or a contributed module would almost definitely be a PHP built-in versus a user-created one. I think that it would probably be safe just to ignore all CamelCased methods and stick to checking only for CamelCase variables.

MrHaroldA’s picture

I also think that it would probably be safe just to ignore all CamelCased methods and stick to checking only for CamelCase variables.

I use the simpletest module and that module uses lots of PHP 5 CamelCase classes.

Also the SimpleXMLElement class is not very appreciated by the Coder module ;)

-H-

douggreen’s picture

Status: Active » Fixed

I changed the camelCase rule to only check for variable (i.e., $camelCase) and function declarations (i.e., function camelCase), and I removed the special rules that excluded hex numbers and StdClass.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.