Closed (works as designed)
Project:
Coder
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Dec 2007 at 15:32 UTC
Updated:
10 Jun 2008 at 17:48 UTC
Ik get the "Functions should be called with no spaces between the function name" warning from the Coder module with the following php code:
$b_valid_type = (checkdate($a_date[1], $a_date[2], $a_date[0]) or (count($a_date) != 3)); // checkdate(): mm-dd-yyyy
The coder module complains about the ') or ('. Replacing it with ') or(' fixes it.
Am I to blame or should 'or' be excluded from the function check?
-H-
Comments
Comment #1
douggreen commentedWhile I don't think we have a coding standard for using '||' instead of 'or', I think that this is the defacto standard.
Is there any difference between '||' and 'or'? If not (and I don't think that there is), I'd change your code to be
) || (.I'm more inclined to suggest that we clean up the coding standard, then add a rule to us '||' instead of 'or'.
Comment #2
mrharolda commentedCoder doesn't give a warning on
) || (, but as far as readability goes, I'd vote for 'or' as coding rule.-H-
Comment #3
treksler commentedIMHO
using '||' instead of 'or' seems to be the Drupal standard and coder should enforce it
Comment #4
mrharolda commentedhttp://drupal.org/coding-standards
You're right...