Problem/Motivation
Per Doxygen and comment formatting conventions for documenting hook implementations and theme preprocess functions, hook implementations can also refer to a template file, e.g. Implements hook_foo_BAR_ID_bar() for xyz_bar.tpl.php. (See #1443202: Apply documentation standards for hook_preprocess_HOOK() for examples.) The function comment sniff therefore needs to support the additional option.
Proposed resolution
Expand the regex to support the additional option.
Remaining tasks
Test and commit the patch.
Original report by Lars Toomre
According to @jhodgdon in #1533244-22: Make help module pass Coder Review point b),
Format should be "* Implements hook_foo()." or "Implements hook_foo_BAR_ID_bar() for xyz_bar()."
* Implements hook_preprocess_HOOK() for block.tpl.php.
We should also file an issue with Coder for this one, because "for *.tpl.php" is acceptable syntax for this.
This is an issue to address this false positive sniff.
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | coder_sniffer-implements-hook-comment-1805544-3.patch | 1.73 KB | traviscarden |
| #1 | coder_sniffer-iplements-hook-comment-1805544-1.patch | 1.2 KB | traviscarden |
Comments
Comment #1
traviscarden commentedThis should do the trick.
Comment #2
klausiNeeds an example Tests/good.php.
Comment #3
traviscarden commentedSure. How 'bout this?
Comment #4
yesct commentedAlso, some "steps to reproduce" or "steps to test" might help bring in people to aid this effort.
(tips on contributor task doc page: http://drupal.org/node/1468198)
Maybe this manual test contributor task doc might inspire someone new to jump in...
http://drupal.org/node/1489010
Comment #5
klausiCommitted, thanks!
Comment #6
yesct commented:) that was quick!
Comment #7.0
(not verified) commentedUpdated issue summary.