Okay, I've gotten rid of all the other flags. But I don't know what to do with these:
Line 825: do not use mixed case (camelCase), use lower case and _
$row_count += $table->Rows;
The table is defined with capital letters and if I try using lower case, I get no data.
Should I just ignore the messages or is there a way to satisfy both you and MySQL?
Comments
Comment #1
sunCould you please post the code that is on line 825 and surrounding lines?
Comment #2
douggreen commentedIt's complaining about the capitalized Rows in $table->Rows. If you provide a little more context for what you're doing (as sun suggested), we might be able to offer a more-Drupalish solution.
Comment #3
nancydruAFAIK, I have no control over what MySQL returns on this query. And it's giving me proper case.
Comment #4
douggreen commentedYou could use
$table = db_fetch_row($result)and$table['Rows']. I'm wondering if (a) this is a hack to just get around the coding standards, or (b) it would be a valuable additional coding standard to use db_fetch_row instead of db_fetch_array when reading tables we didn't create...Comment #5
douggreen commentedSorry, I meant to say
db_fetch_arrayComment #6
nancydruI've always wondered which was faster, array or object. I've just developed the habit of using objects. I've seen others who prefer arrays. But I have no problem either changing my code, or just ignoring the messages.
b) Could you catch and warn about this?
Comment #7
douggreen commentedIt's kinda the Drupal way to use arrays instead of objects, I think mostly to support php4; however Drupal does use objects for things like $node, so it's not completely standardized. I don't think anyone will admonish you for the way you did it, I was just offering an alternative approach. But I do think most Drupal developers would lean towards using the array.
Comment #8
nancydruNot a big deal for me to change but virtually every module I've looked, core or contributed, has used objects. But I will admit, $node is the biggest thing I see in Drupal.
Comment #9
douggreen commentedComment #10
samirnassar commentedI ran a recent pathauto through coder and it complained about the function being camelcased.
Coder only cared about the function name, not the rest. Since this is a snippet from pathauto/tests/pathauto.test
greggles thinks that camelcase is allowed in tests and therefore this might be a bug in coder.
Feedback?
Comment #11
nancydruWell, I was trying to read some of the docs about Views 2 and saw some similar camel case stuff. Is this a normal OOP technique? If so, perhaps Coder needs to change.
Comment #12
jcnventuraPlease comment the CamelCase problems for tests in here #271028: Coder should not check camelCase for class methods.