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.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | coder-coder_sniffer-1519442-5.patch | 1.55 KB | traviscarden |
| #3 | coder-coder_sniffer-1519442-3.patch | 975 bytes | traviscarden |
Comments
Comment #1
klausiDrupal 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.
Comment #2
traviscarden commentedComment #3
traviscarden commentedSince the standards specifically forbid
@return void, I'm calling this a bug. The fix is simple, though. Patch attached.Comment #4
klausiI 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.
Comment #5
traviscarden commentedAgreed. Here's a new patch.
Comment #6
klausiCommitted a slightly modified version without $data, thanks! http://drupalcode.org/project/coder.git/commit/5e7ec9b
Comment #8
plazik commentedtheme_foofunctions should not have@returnvalue, see https://drupal.org/node/1354#themeable.Patch @5 doesn't work for these functions.
Comment #9
traviscarden commented@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!