#23118 closed enhancement (fixed)
Remove spaces between parentheses in function calls without arguments
Reported by: | evansolomon | Owned by: | westi |
---|---|---|---|
Milestone: | 3.6 | Priority: | lowest |
Severity: | trivial | Version: | |
Component: | General | Keywords: | has-patch |
Focuses: | Cc: |
Description
I noticed there were a few spots with weird spaces in function calls. So it would like like foo( )
instead of foo()
. It looks weird, so let's kill them off.
Here's what I ran to fix them: ack "\( \)" --ignore-dir=wp-content -l | xargs perl -pi -E 's/\( \)/\(\)/g'
Attachments (1)
Change History (9)
#2
@
12 years ago
- Milestone changed from Awaiting Review to 3.6
- Priority changed from normal to lowest
- Type changed from defect (bug) to enhancement
#4
in reply to:
↑ 3
;
follow-up:
↓ 7
@
12 years ago
Replying to westi:
It could be argued that our coding style recommends the presence of these.
I imagine such a coding standard would quickly top the list of least-followed rules in WordPress.
Just for fun...
$ ack "\(\)" --php -h | wc -l 10637
#5
@
12 years ago
I like spaces. But I dislike them in two places: inside array brackets when the index is a static string (so, $foo['bar']
), and here. Core overwhelmingly agrees. I searched for function definitions ending with () {
and found 1290 matches.
Ending with ( ) {
— 11.
And six of those were totally westi in default-constants.php. :)
It could be argued that our coding style recommends the presence of these.
However, I agree that they do look weird - although I make no promises not to accidentally add more of them in future ;)