#23118 closed enhancement (fixed)
Remove spaces between parentheses in function calls without arguments
| Reported by: | evansolomon | Owned by: | westi |
|---|---|---|---|
| Priority: | lowest | Milestone: | 3.6 |
| Component: | General | Version: | |
| Severity: | trivial | Keywords: | has-patch |
| Cc: | Focuses: |
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
@
14 years ago
- Milestone Awaiting Review → 3.6
- Priority normal → lowest
- Type defect (bug) → enhancement
#4
in reply to: ↑ 3
;
follow-up:
↓ 7
@
14 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
@
14 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. :)
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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 ;)