From bd10086a9ac99706aaa9b78d2c36aa3dbcc5d90f Mon Sep 17 00:00:00 2001
From: Lars Toomre <ltoomre@23809.no-reply.drupal.org>
Date: Mon, 8 Oct 2012 20:15:30 -0400
Subject: [PATCH] Issue 1800774 by Lars Toomre: Add type hinting to
 node.api.php file.

---
 core/modules/node/node.api.php |   64 ++++++++++++++++++++--------------------
 1 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php
index 2daa954..2636764 100644
--- a/core/modules/node/node.api.php
+++ b/core/modules/node/node.api.php
@@ -181,12 +181,12 @@
  * sure to restore your {node_access} record after node_access_rebuild() is
  * called.
  *
- * @param $account
+ * @param object $account
  *   The user object whose grants are requested.
- * @param $op
+ * @param string $op
  *   The node operation to be performed, such as "view", "update", or "delete".
  *
- * @return
+ * @return array
  *   An array whose keys are "realms" of grants, and whose values are arrays of
  *   the grant IDs within this realm that this user is being granted.
  *
@@ -258,7 +258,7 @@ function hook_node_grants($account, $op) {
  * @param Drupal\node\Node $node
  *   The node that has just been saved.
  *
- * @return
+ * @return array
  *   An array of grants as defined above.
  *
  * @see _node_access_write_grants()
@@ -313,7 +313,7 @@ function hook_node_access_records(Drupal\node\Node $node) {
  *
  * A module may deny all access to a node by setting $grants to an empty array.
  *
- * @param $grants
+ * @param array $grants
  *   The $grants array returned by hook_node_access_records().
  * @param Drupal\node\Node $node
  *   The node for which the grants were acquired.
@@ -361,11 +361,11 @@ function hook_node_access_records_alter(&$grants, Drupal\node\Node $node) {
  * permissions assigned to a user role, or specific attributes of a user
  * account.
  *
- * @param $grants
+ * @param array $grants
  *   The $grants array returned by hook_node_grants().
- * @param $account
+ * @param object $account
  *   The user account requesting access to content.
- * @param $op
+ * @param string $op
  *   The operation being performed, 'view', 'update' or 'delete'.
  *
  * @see hook_node_grants()
@@ -401,7 +401,7 @@ function hook_node_grants_alter(&$grants, $account, $op) {
  * callback function receives one initial argument, which is an array of the
  * checked nodes.
  *
- * @return
+ * @return array
  *   An array of operations. Each operation is an associative array that may
  *   contain the following key-value pairs:
  *   - 'label': Required. The label for the operation, displayed in the dropdown
@@ -544,9 +544,9 @@ function hook_node_insert(Drupal\node\Node $node) {
  * hook_entity_load() is invoked on all implementing modules, and finally
  * hook_node_load() is invoked on all implementing modules.
  *
- * @param $nodes
+ * @param array $nodes
  *   An array of the nodes being loaded, keyed by nid.
- * @param $types
+ * @param array $types
  *   An array containing the node types present in $nodes. Allows for an early
  *   return for modules that only support certain node types. However, if your
  *   module defines a content type, you can use hook_load() to respond to
@@ -661,7 +661,7 @@ function hook_node_prepare(Drupal\node\Node $node) {
  *
  * @param Drupal\node\Node $node
  *   The node being displayed in a search result.
- * @param $langcode
+ * @param string $langcode
  *   Language code of result being displayed.
  *
  * @return array
@@ -727,7 +727,7 @@ function hook_node_update(Drupal\node\Node $node) {
  *
  * @param Drupal\node\Node $node
  *   The node being indexed.
- * @param $langcode
+ * @param string $langcode
  *   Language code of the variant of the node being indexed.
  *
  * @return string
@@ -761,9 +761,9 @@ function hook_node_update_index(Drupal\node\Node $node, $langcode) {
  *
  * @param Drupal\node\Node $node
  *   The node being validated.
- * @param $form
+ * @param array $form
  *   The form being used to edit the node.
- * @param $form_state
+ * @param array $form_state
  *   The form state array.
  *
  * @ingroup node_api_hooks
@@ -789,9 +789,9 @@ function hook_node_validate(Drupal\node\Node $node, $form, &$form_state) {
  *
  * @param Drupal\node\Node $node
  *   The node entity being updated in response to a form submission.
- * @param $form
+ * @param array $form
  *   The form being used to edit the node.
- * @param $form_state
+ * @param array $form_state
  *   The form state array.
  *
  * @ingroup node_api_hooks
@@ -818,9 +818,9 @@ function hook_node_submit(Drupal\node\Node $node, $form, &$form_state) {
  *
  * @param Drupal\node\Node $node
  *   The node that is being assembled for rendering.
- * @param $view_mode
+ * @param string $view_mode
  *   The $view_mode parameter from node_view().
- * @param $langcode
+ * @param string $langcode
  *   The language code used for rendering.
  *
  * @see forum_node_view()
@@ -850,7 +850,7 @@ function hook_node_view(Drupal\node\Node $node, $view_mode, $langcode) {
  * node.tpl.php. See drupal_render() and theme() documentation respectively
  * for details.
  *
- * @param $build
+ * @param array $build
  *   A renderable array representing the node content.
  * @param Drupal\node\Node $node
  *   The node being rendered.
@@ -883,7 +883,7 @@ function hook_node_view_alter(&$build, Drupal\node\Node $node) {
  * database table, and should be maintained by using the node_type_save() and
  * node_type_delete() functions.
  *
- * @return
+ * @return array
  *   An array of information defining the module's node types. The array
  *   contains a sub-array for each node type, with the the machine name of a
  *   content type as the key. Each sub-array has up to 10 attributes.
@@ -947,7 +947,7 @@ function hook_node_info() {
  * and then the weighted scores from all ranking mechanisms are added, which
  * brings about the same result as a weighted average.
  *
- * @return
+ * @return array
  *   An associative array of ranking data. The keys should be strings,
  *   corresponding to the internal name of the ranking mechanism, such as
  *   'recent', or 'comments'. The values should be arrays themselves, with the
@@ -995,7 +995,7 @@ function hook_ranking() {
  * This hook is invoked from node_type_save() after the node type is added
  * to the database.
  *
- * @param $info
+ * @param object $info
  *   The node type object that is being created.
  */
 function hook_node_type_insert($info) {
@@ -1008,7 +1008,7 @@ function hook_node_type_insert($info) {
  * This hook is invoked from node_type_save() after the node type is updated
  * in the database.
  *
- * @param $info
+ * @param object $info
  *   The node type object that is being updated.
  */
 function hook_node_type_update($info) {
@@ -1025,7 +1025,7 @@ function hook_node_type_update($info) {
  * This hook is invoked from node_type_delete() after the node type is removed
  * from the database.
  *
- * @param $info
+ * @param object $info
  *   The node type object that is being deleted.
  */
 function hook_node_type_delete($info) {
@@ -1100,10 +1100,10 @@ function hook_prepare(Drupal\node\Node $node) {
  *
  * @param Drupal\node\Node $node
  *   The node being added or edited.
- * @param $form_state
+ * @param array $form_state
  *   The form state array.
  *
- * @return
+ * @return array
  *   An array containing the title and any custom form elements to be displayed
  *   in the node editing form.
  *
@@ -1184,7 +1184,7 @@ function hook_insert(Drupal\node\Node $node) {
  * information for all available nodes should be loaded in a single query where
  * possible.
  *
- * @param $nodes
+ * @param array $nodes
  *   An array of the nodes being loaded, keyed by nid.
  *
  * For a detailed usage example, see node_example.module.
@@ -1239,9 +1239,9 @@ function hook_update(Drupal\node\Node $node) {
  *
  * @param Drupal\node\Node $node
  *   The node being validated.
- * @param $form
+ * @param array $form
  *   The form being used to edit the node.
- * @param $form_state
+ * @param array $form_state
  *   The form state array.
  *
  * @ingroup node_api_hooks
@@ -1266,10 +1266,10 @@ function hook_validate(Drupal\node\Node $node, $form, &$form_state) {
  *
  * @param Drupal\node\Node $node
  *   The node to be displayed, as returned by node_load().
- * @param $view_mode
+ * @param string $view_mode
  *   View mode, e.g. 'full', 'teaser', ...
  *
- * @return
+ * @return Drupal\node\Node
  *   The passed $node parameter should be modified as necessary and
  *   returned so it can be properly presented. Nodes are prepared for display
  *   by assembling a structured array, formatted as in the Form API, in
-- 
1.7.6.msysgit.0

