Closed (fixed)
Project:
Coder
Version:
6.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Aug 2007 at 01:20 UTC
Updated:
27 Dec 2007 at 01:21 UTC
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
Comment #1
douggreen commentedGood 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.
Comment #2
Susurrus commentedI 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.
Comment #3
mrharolda commentedI 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-
Comment #4
douggreen commentedI 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.
Comment #5
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.