part of #2011290: [meta] standards cleanup to get ready for getting into core
Problem/Motivation
Not always type hinting and doing hook standards from https://drupal.org/node/1354#drupal
Hook definition
The summary starts with an imperative verb that tells why a module would want to implement the hook. Example: "Respond to node deletion." Hook definitions are placed in a .api.php file, which is not directly loaded by Drupal. Each is a fake function whose name starts with "hook", and whose function body is a sample implementation. Parameters and return value that the implementer must use need to be documented.
Proposed resolution
update according to standards
Remaining tasks
patch
User interface changes
No.
API changes
No.
Comment | File | Size | Author |
---|---|---|---|
#3 | config_translation.hooks_.2011294.3.patch | 1.92 KB | YesCT |
#3 | interdiff-1-3.txt | 819 bytes | YesCT |
#1 | config_translation.hooks_.2011294.1.patch | 1.97 KB | YesCT |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedadd type hinting, @return,
https://drupal.org/node/1354#drupal
hook one line imperative verb tense,
also \ prefix to name spaces in comments.
https://drupal.org/node/1354#classes
@return is probably the only core gate blocker here.
Comment #2
Gábor HojtsyThanks, great improvements. Just one nit:
This should return an array with items either of type ConfigGroupMapper or ConfigEntityMapper. Its not mixed, its an array AFAIS.
Comment #3
YesCT CreditAttribution: YesCT commentedthis changes to array and simplifies the comment.
Comment #4
Gábor HojtsySuperb, looks good now, committed.