diff --git a/core/modules/node/node.api.php b/core/modules/node/node.api.php index 6f4cacc..801a025 100644 --- a/core/modules/node/node.api.php +++ b/core/modules/node/node.api.php @@ -391,7 +391,7 @@ function hook_node_search_result(\Drupal\node\NodeInterface $node, $langcode) { * * @param \Drupal\node\NodeInterface $node * The node being indexed. - * @param object $langcode + * @param string $langcode * Language code of the variant of the node being indexed. * * @return string diff --git a/core/modules/node/node.module b/core/modules/node/node.module index 94559fa..b6ce347 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -178,10 +178,11 @@ function node_entity_view_display_alter(EntityViewDisplayInterface $display, $co * query joins the {comment_entity_statistics} table so that the comment_count * field is available, a title attribute will be added to show the number of * comments. - * @param $title - * (optional) A heading for the resulting list. + * @param string|null $title + * (optional) A heading for the resulting list. NULL results in no heading. + * Defaults to NULL. * - * @return + * @return array * A renderable array containing a list of linked node titles fetched from * $result, or FALSE if there are no rows in $result. */ @@ -293,7 +294,7 @@ function node_type_get_description(NodeTypeInterface $node_type) { /** * Menu argument loader: Loads a node type by string. * - * @param $name + * @param string $name * The machine name of a node type to load. * * @return \Drupal\node\NodeTypeInterface @@ -314,7 +315,8 @@ function node_type_load($name) { * @param string $label * (optional) The label for the body instance. * - * @return \Drupal\field\Entity\FieldConfig Body field. + * @return \Drupal\field\Entity\FieldConfig + * Body field. */ function node_add_body_field(NodeTypeInterface $type, $label = 'Body') { // Add or remove the body field, as needed. @@ -386,7 +388,7 @@ function node_entity_extra_field_info() { * @param string $new_id * The new node type of the nodes. * - * @return + * @return int * The number of nodes whose node type field was modified. */ function node_type_update_nodes($old_id, $new_id) { @@ -460,10 +462,10 @@ function node_revision_load($vid = NULL) { /** * Deletes a node revision. * - * @param $revision_id + * @param mixed $revision_id * The revision ID to delete. * - * @return + * @return bool * TRUE if the revision deletion was successful; otherwise, FALSE. */ function node_revision_delete($revision_id) { @@ -476,8 +478,8 @@ function node_revision_delete($revision_id) { * @param \Drupal\node\NodeInterface $node * A node entity. * - * @return - * The ID of the node if this is a full page view, otherwise FALSE. + * @return bool + * TRUE if this is a full page view, otherwise FALSE. */ function node_is_page(NodeInterface $node) { $route_match = \Drupal::routeMatch(); @@ -729,7 +731,7 @@ function node_user_predelete($account) { * @param \Drupal\node\NodeInterface $node * The node entity. * - * @return + * @return string * An unsanitized string that is the title of the node. * * @see node_menu() @@ -741,7 +743,7 @@ function node_page_title(NodeInterface $node) { /** * Finds the last time a node was changed. * - * @param $nid + * @param mixed $nid * The ID of a node. * @param string $langcode * (optional) The language the node has been last modified in. Defaults to the @@ -761,10 +763,10 @@ function node_last_changed($nid, $langcode = NULL) { /** * Finds the most recently changed nodes that are available to the current user. * - * @param $number + * @param int $number * (optional) The maximum number of nodes to find. Defaults to 10. * - * @return + * @return \Drupal\node\NodeInterface[] * An array of node entities or an empty array if there are no recent nodes * visible to the current user. */ @@ -805,13 +807,13 @@ function node_get_recent($number = 10) { * * @param \Drupal\node\NodeInterface $node * A node entity. - * @param $view_mode - * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'full.' - * @param $langcode + * @param string $view_mode + * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'full'. + * @param string|null $langcode * (optional) A language code to use for rendering. Defaults to NULL which is * the global content language of the current request. * - * @return + * @return array * An array as expected by drupal_render(). */ function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) { @@ -821,15 +823,15 @@ function node_view(NodeInterface $node, $view_mode = 'full', $langcode = NULL) { /** * Constructs a drupal_render() style array from an array of loaded nodes. * - * @param $nodes + * @param \Drupal\Core\Entity\EntityInterface[] $nodes * An array of nodes as returned by Node::loadMultiple(). - * @param $view_mode - * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'teaser.' - * @param $langcode - * (optional) A language code to use for rendering. Defaults to the global - * content language of the current request. + * @param string $view_mode + * (optional) View mode, e.g., 'full', 'teaser'... Defaults to 'teaser'. + * @param string|null $langcode + * (optional) A language code to use for rendering. NULL means use the global + * content language of the current request. Defaults to NULL. * - * @return + * @return array * An array in the format expected by drupal_render(). */ function node_view_multiple($nodes, $view_mode = 'teaser', $langcode = NULL) { @@ -1004,11 +1006,11 @@ function node_access_grants($op, AccountInterface $account) { * 'node_access'; when this function returns TRUE, no node access joins are * added to the query. * - * @param $account + * @param Drupal\Core\Session\AccountProxyInterface $account * (optional) The user object for the user whose access is being checked. If * omitted, the current user is used. Defaults to NULL. * - * @return + * @return bool * TRUE if 'view' access to all nodes is granted, FALSE otherwise. * * @see hook_node_grants() @@ -1112,10 +1114,11 @@ function node_query_node_access_alter(AlterableInterface $query) { * When unsure if the current user is an administrator, node_access_rebuild() * should be used instead. * - * @param $rebuild - * (optional) The boolean value to be written. + * @param bool|null $rebuild + * (optional) The boolean value to be written. Defaults to NULL, which returns + * the current value. * - * @return + * @return bool * The current value of the flag if no value was provided for $rebuild. * * @see node_access_rebuild() @@ -1144,7 +1147,7 @@ function node_access_needs_rebuild($rebuild = NULL) { * Note : As of Drupal 6, node access modules are not required to (and actually * should not) call node_access_rebuild() in hook_install/uninstall anymore. * - * @param $batch_mode + * @param bool $batch_mode * (optional) Set to TRUE to process in 'batch' mode, spawning processing over * several HTTP requests (thus avoiding the risk of PHP timeout if the site * has a large number of nodes). hook_update_N() and any form submit handler diff --git a/core/modules/node/src/NodeAccessControlHandlerInterface.php b/core/modules/node/src/NodeAccessControlHandlerInterface.php index 23509e5..2bad6a1 100644 --- a/core/modules/node/src/NodeAccessControlHandlerInterface.php +++ b/core/modules/node/src/NodeAccessControlHandlerInterface.php @@ -44,16 +44,10 @@ public function acquireGrants(NodeInterface $node); * * @param \Drupal\node\NodeInterface $node * The node whose grants are being written. - * @param $grants - * A list of grants to write. See hook_node_access_records() for the - * expected structure of the grants array. - * @param $realm - * (optional) If provided, read/write grants for that realm only. Defaults to - * NULL. - * @param $delete - * (optional) If false, does not delete records. This is only for optimization - * purposes, and assumes the caller has already performed a mass delete of - * some form. Defaults to TRUE. + * @param bool $delete + * (optional) If false, does not delete records. This is only for + * optimization purposes, and assumes the caller has already performed a + * mass delete of some form. Defaults to TRUE. */ public function writeGrants(NodeInterface $node, $delete = TRUE); diff --git a/core/modules/node/src/NodeForm.php b/core/modules/node/src/NodeForm.php index 92e7c0c..3a2f1a3 100644 --- a/core/modules/node/src/NodeForm.php +++ b/core/modules/node/src/NodeForm.php @@ -330,9 +330,9 @@ public function submitForm(array &$form, FormStateInterface $form_state) { /** * Form submission handler for the 'preview' action. * - * @param $form + * @param array $form * An associative array containing the structure of the form. - * @param $form_state + * @param Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. */ public function preview(array $form, FormStateInterface $form_state) { @@ -348,10 +348,13 @@ public function preview(array $form, FormStateInterface $form_state) { /** * Form submission handler for the 'publish' action. * - * @param $form + * @param array $form * An associative array containing the structure of the form. - * @param $form_state + * @param Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. + * + * @return \Drupal\Core\Entity\EntityInterface + * The published node. */ public function publish(array $form, FormStateInterface $form_state) { $node = $this->entity; @@ -362,10 +365,13 @@ public function publish(array $form, FormStateInterface $form_state) { /** * Form submission handler for the 'unpublish' action. * - * @param $form + * @param array $form * An associative array containing the structure of the form. - * @param $form_state + * @param Drupal\Core\Form\FormStateInterface $form_state * The current state of the form. + * + * @return \Drupal\Core\Entity\EntityInterface + * The unpublished node. */ public function unpublish(array $form, FormStateInterface $form_state) { $node = $this->entity; diff --git a/core/modules/node/src/NodeStorageInterface.php b/core/modules/node/src/NodeStorageInterface.php index 1ca7fab..af194fb 100644 --- a/core/modules/node/src/NodeStorageInterface.php +++ b/core/modules/node/src/NodeStorageInterface.php @@ -19,7 +19,7 @@ /** * Returns a list of node revision IDs for a specific node. * - * @param \Drupal\node\NodeInterface + * @param \Drupal\node\NodeInterface $node * The node entity. * * @return int[] @@ -41,7 +41,7 @@ public function userRevisionIds(AccountInterface $account); /** * Counts the number of revisions in the default language. * - * @param \Drupal\node\NodeInterface + * @param \Drupal\node\NodeInterface $node * The node entity. * * @return int @@ -66,7 +66,7 @@ public function updateType($old_type, $new_type); * Unsets the language for all nodes with the given language. * * @param \Drupal\Core\Language\LanguageInterface $language - * The language object. + * The language object. */ public function clearRevisionsLanguage(LanguageInterface $language); } diff --git a/core/modules/node/src/Plugin/Search/NodeSearch.php b/core/modules/node/src/Plugin/Search/NodeSearch.php index 83140c1..f16fcf1 100644 --- a/core/modules/node/src/Plugin/Search/NodeSearch.php +++ b/core/modules/node/src/Plugin/Search/NodeSearch.php @@ -338,7 +338,7 @@ protected function prepareResults(StatementInterface $found) { /** * Adds the configured rankings to the search query. * - * @param $query + * @param \Drupal\Core\Database\Query\SelectExtender $query * A query object that has been extended with the Search DB Extender. */ protected function addNodeRankings(SelectExtender $query) { diff --git a/core/modules/node/src/Plugin/views/argument/Nid.php b/core/modules/node/src/Plugin/views/argument/Nid.php index 07f93ec..c00281e 100644 --- a/core/modules/node/src/Plugin/views/argument/Nid.php +++ b/core/modules/node/src/Plugin/views/argument/Nid.php @@ -36,6 +36,7 @@ class Nid extends Numeric { * @param mixed $plugin_definition * The plugin implementation definition. * @param NodeStorageInterface $node_storage + * The node storage service. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, NodeStorageInterface $node_storage) { parent::__construct($configuration, $plugin_id, $plugin_definition); diff --git a/core/modules/node/src/Plugin/views/argument/Vid.php b/core/modules/node/src/Plugin/views/argument/Vid.php index 43246d8..693e380 100644 --- a/core/modules/node/src/Plugin/views/argument/Vid.php +++ b/core/modules/node/src/Plugin/views/argument/Vid.php @@ -45,7 +45,7 @@ class Vid extends Numeric { * The plugin implementation definition. * @param \Drupal\Core\Database\Connection $database * Database Service Object. - * @param \Drupal\node\NodeStorageInterface + * @param \Drupal\node\NodeStorageInterface $node_storage * The node storage. */ public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database, NodeStorageInterface $node_storage) { diff --git a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php index d5e4dd4..b0a7e20 100644 --- a/core/modules/node/src/Tests/NodeAccessBaseTableTest.php +++ b/core/modules/node/src/Tests/NodeAccessBaseTableTest.php @@ -139,7 +139,7 @@ function testNodeAccessBasic() { /** * Checks taxonomy/term listings to ensure only accessible nodes are listed. * - * @param $is_admin + * @param bool $is_admin * A boolean indicating whether the current user is an administrator. If * TRUE, all nodes should be listed. If FALSE, only public nodes and the * user's own private nodes should be listed.