When verifying that a module has doc blocks for all its hooks, the following warnings arise:

$ drush mb-dochooks twitter
Invalid argument supplied for foreach() process.inc:85                                                                                                       [warning]
array_keys() expects parameter 1 to be array, null given process.inc:67                                                                                      [warning]
file_get_contents(/sites/all/modules/contrib/twitter/twitter.inc): failed to open stream: No such file or directory module_builder.drush.inc:773             [warning]
array_intersect(): Argument #2 is not an array module_builder.drush.inc:780                                                                                  [warning]
Invalid argument supplied for foreach() module_builder.drush.inc:783                                                                                         [warning]
implode(): Invalid arguments passed module_builder.drush.inc:793                                                                                             [warning]
Added hook documentation headers for: 
Are you sure you want to overwrite sites/all/modules/contrib/twitter/twitter.inc? (y/n): 

This happens because hooks are not being loaded correctly (wrong signature call to module_builder_get_hook_names() and Drush root path is not being set when reading the module's files ($filepath variable not being set).

Patch coming up in the next comment.

Comments

juampynr’s picture

Status: Active » Needs review
StatusFileSize
new1.25 KB

Here is the patch.

joachim’s picture

Status: Needs review » Fixed

Committed, thanks!
I've fixed the missing @params for module_builder_get_hook_names() and the other functions in the same file.

- #1428810 by juampy: Fixed mb-dochooks not loading hooks or module file paths correctly.

Status: Fixed » Closed (fixed)

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