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.

Files: 
CommentFileSizeAuthor
#3 config_translation.hooks_.2011294.3.patch1.92 KBYesCT
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config_translation.hooks_.2011294.3.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]
#3 interdiff-1-3.txt819 bytesYesCT
#1 config_translation.hooks_.2011294.1.patch1.97 KBYesCT
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config_translation.hooks_.2011294.1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Title:config_translation.api.php standards cleanup to get ready for getting into coreconfig_translation.api.php hooks standards cleanup to get ready for getting into core
Status:Active» Needs review
StatusFileSize
new1.97 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config_translation.hooks_.2011294.1.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

add 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

If you use a namespace in documentation, always make sure it is a fully-qualified namespace (beginning with a backslash).

@return is probably the only core gate blocker here.

Status:Needs review» Needs work

Thanks, great improvements. Just one nit:

+++ b/config_translation.api.phpundefined
@@ -11,14 +11,17 @@
+ *
+ * @return mixed
+ *   A mapping of configuration name groups to paths and other options,
+ *   encapsulated in ConfigGroupMapper instances from
+ *   \Drupal\config_translation\ConfigGroupMapper or ConfigEntityMapper
+ *   instances from \Drupal\config_translation\ConfigEntityMapper.

This should return an array with items either of type ConfigGroupMapper or ConfigEntityMapper. Its not mixed, its an array AFAIS.

Status:Needs work» Needs review
StatusFileSize
new819 bytes
new1.92 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch config_translation.hooks_.2011294.3.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

this changes to array and simplifies the comment.

Status:Needs review» Fixed

Superb, looks good now, committed.

Status:Fixed» Closed (fixed)

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