The coding standards state (as is clarified in #1510838: Define and document @return void policy) that if there is no return value from a function/method the DocBlock should not include a @return directive. Perhaps we should add a sniff for @return void.

Comments

klausi’s picture

Status: Active » Closed (won't fix)

Drupal Code Sniffer has been merged into Coder 7.x-2.x. Please move this issue to the Coder queue and reopen it if the problem still exists.

traviscarden’s picture

Project: Drupal Code Sniffer » Coder
Component: Code » Coder Sniffer
Status: Closed (won't fix) » Active
traviscarden’s picture

Category: Task » Bug report
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new975 bytes

Since the standards specifically forbid @return void, I'm calling this a bug. The fix is simple, though. Patch attached.

klausi’s picture

Status: Needs review » Needs work

I think we should have a more meaningful message in this case, just copy "If there is no return value for a function, there must not be a @return tag." from the coding standards doc page.

traviscarden’s picture

Status: Needs work » Needs review
StatusFileSize
new1.55 KB

Agreed. Here's a new patch.

klausi’s picture

Status: Needs review » Fixed

Committed a slightly modified version without $data, thanks! http://drupalcode.org/project/coder.git/commit/5e7ec9b

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

plazik’s picture

Status: Closed (fixed) » Needs work

theme_foo functions should not have @return value, see https://drupal.org/node/1354#themeable.
Patch @5 doesn't work for these functions.

traviscarden’s picture

Status: Needs work » Closed (fixed)

@Plazik, this issue has already been closed. Can you create a new issue describing the behavior you expect versus the behavior you get with clear steps to reproduce? Thanks!