Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
other
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Nov 2008 at 00:33 UTC
Updated:
20 May 2010 at 06:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
damien tournoud commentedI generally try to not argue too much about the color of the bike shed, but I really prefer the latter.
Comment #2
catchI prefer it with a space too.
Comment #3
mecano commentedI second that
Comment #4
sunLet's discuss over at: http://groups.drupal.org/node/16598, not here.
Comment #5
jhodgdonIt looks like the discussion ended long ago, and casts should have a space between the (type) and the $variable.
I just added that to the coding standards page.
So it looks like the next step would be to make a patch.
Comment #6
aspilicious commentedHere is a patch.
I grepped with
\(.+\)\(.*\$.*\)
and
\(.+\)\$.+
Comment #7
aspilicious commentedComment #8
sunComment #9
beeradb commentedI'm late to the party, but I fully endorse having the space. Drupal tends to respect/like a lot of whitespace anyway, so it just makes sense.
Comment #10
beeradb commented#6: casting_var.patch queued for re-testing.
Comment #12
aspilicious commentedLet's get this in before I have to reroll again :(
RTBC by #8
Comment #13
aspilicious commentedComment #14
dries commentedPersonally, I like it better without the extra space.
Comment #15
sunhah, I just learned that I was somehow opposed to the space some time ago. In the meantime, I love it. ;)
It's not only consistent with other Drupal coding standards, but also consistent with example code in PHP's documentation, as Morbus correctly states.
The grep statistics in the OD of this issue should have changed in the meantime, as we apply this standard to new and changed code for quite some time already.
Comment #16
jhodgdonI agree with sun [for a change :) ].
Comment #17
realityloop commented#12: casting_var_V2.patch queued for re-testing.
Comment #19
aspilicious commentedReroll
Comment #20
aspilicious commentedIf this is green, please commit :( ...
I'll make followups if necessary...
Comment #21
jhodgdonThis was RTBC before the reroll, setting back to that.
Comment #22
dries commentedPatch no longer applies. Needs to be re-rolled.
Comment #23
aspilicious commentedHopefully last reroll
Comment #24
webchickFrom #22 sounds like Dries was in favour of this. Plus I'm tired, so I need something easy to commit. ;)
Committed to HEAD. Thanks!
Looks like this is already in the coding standards http://drupal.org/coding-standards#cast so we should be good to go here.