Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#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)

23118.diff (9.8 KB ) - added by evansolomon 14 years ago.

Download all attachments as: .zip

Change History (9)

@evansolomon
14 years ago

#1 @evansolomon
14 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
14 years ago

  • Milestone Awaiting Review3.6
  • Priority normallowest
  • Type defect (bug)enhancement

#3 follow-ups: @westi
14 years ago

  • Owner set to westi
  • Status newaccepted

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 ;)

#4 in reply to: ↑ 3 ; follow-up: @evansolomon
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 @nacin
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. :)

#6 @westi
14 years ago

  • Resolutionfixed
  • Status acceptedclosed

In 23265:

Tighten our braces. Fixes #23118 props evansolomon.

#7 in reply to: ↑ 4 @westi
14 years ago

Replying to evansolomon:

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.

Coding standards are always guides not rules.

#8 in reply to: ↑ 3 @SergeyBiryukov
14 years ago

Replying to westi:

It could be argued that our coding style recommends the presence of these.

I guess the space usage rule from our coding standards only applies if the function has arguments.

Note: See TracTickets for help on using tickets.