From 269f03db3fd9d89816900d61ea5fc6ad79fd4e11 Mon Sep 17 00:00:00 2001 From: xjm Date: Mon, 18 May 2015 14:33:21 -0700 Subject: [PATCH] Issue #2472147 by googletorp, anavarre, jaredsmith, bojanz: Standardize getter docblocks in node module --- core/modules/node/src/Form/NodePreviewForm.php | 2 +- core/modules/node/src/NodeInterface.php | 10 +++++----- core/modules/node/src/NodePermissions.php | 7 +++++-- core/modules/node/src/NodeStorageInterface.php | 4 ++-- core/modules/node/src/NodeTypeInterface.php | 14 +++++++------- core/modules/node/src/Plugin/views/wizard/Node.php | 2 ++ core/modules/node/src/Tests/NodeCreationTest.php | 12 ++++++++---- core/modules/node/src/Tests/NodeTestBase.php | 4 +++- 8 files changed, 33 insertions(+), 22 deletions(-) diff --git a/core/modules/node/src/Form/NodePreviewForm.php b/core/modules/node/src/Form/NodePreviewForm.php index 52f0267d300..453962f72e2 100644 --- a/core/modules/node/src/Form/NodePreviewForm.php +++ b/core/modules/node/src/Form/NodePreviewForm.php @@ -125,7 +125,7 @@ class NodePreviewForm extends FormBase implements ContainerInjectionInterface { } /** - * Retrieves the list of available view modes for the current node. + * Gets the list of available view modes for the current node. * * @param EntityInterface $node * The node being previewed. diff --git a/core/modules/node/src/NodeInterface.php b/core/modules/node/src/NodeInterface.php index 4ca91c72a5e..9610a99353c 100644 --- a/core/modules/node/src/NodeInterface.php +++ b/core/modules/node/src/NodeInterface.php @@ -18,7 +18,7 @@ use Drupal\user\UserInterface; interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface { /** - * Returns the node type. + * Gets the node type. * * @return string * The node type. @@ -26,7 +26,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, public function getType(); /** - * Returns the node title. + * Gets the node title. * * @return string * Title of the node. @@ -45,7 +45,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, public function setTitle($title); /** - * Returns the node creation timestamp. + * Gets the node creation timestamp. * * @return int * Creation timestamp of the node. @@ -123,7 +123,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, public function setPublished($published); /** - * Returns the node revision creation timestamp. + * Gets the node revision creation timestamp. * * @return int * The UNIX timestamp of when this revision was created. @@ -142,7 +142,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, public function setRevisionCreationTime($timestamp); /** - * Returns the node revision author. + * Gets the node revision author. * * @return \Drupal\user\UserInterface * The user entity for the revision author. diff --git a/core/modules/node/src/NodePermissions.php b/core/modules/node/src/NodePermissions.php index 5f25c64938c..74a64423398 100644 --- a/core/modules/node/src/NodePermissions.php +++ b/core/modules/node/src/NodePermissions.php @@ -20,9 +20,10 @@ class NodePermissions { use UrlGeneratorTrait; /** - * Returns an array of content permissions. + * Gets an array of content permissions. * * @return array + * The content permissions. */ public function contentPermissions() { return array( @@ -34,9 +35,11 @@ class NodePermissions { } /** - * Returns an array of node type permissions. + * Gets an array of node type permissions. * * @return array + * The node type permissions. + * @see \Drupal\user\PermissionHandlerInterface::getPermissions() */ public function nodeTypePermissions() { $perms = array(); diff --git a/core/modules/node/src/NodeStorageInterface.php b/core/modules/node/src/NodeStorageInterface.php index 1ca7fabdb07..3a56e63a817 100644 --- a/core/modules/node/src/NodeStorageInterface.php +++ b/core/modules/node/src/NodeStorageInterface.php @@ -17,7 +17,7 @@ use Drupal\Core\Session\AccountInterface; interface NodeStorageInterface extends EntityStorageInterface { /** - * Returns a list of node revision IDs for a specific node. + * Gets a list of node revision IDs for a specific node. * * @param \Drupal\node\NodeInterface * The node entity. @@ -28,7 +28,7 @@ interface NodeStorageInterface extends EntityStorageInterface { public function revisionIds(NodeInterface $node); /** - * Returns a list of revision IDs having a given user as node author. + * Gets a list of revision IDs having a given user as node author. * * @param \Drupal\Core\Session\AccountInterface $account * The user entity. diff --git a/core/modules/node/src/NodeTypeInterface.php b/core/modules/node/src/NodeTypeInterface.php index 6fc9ea99191..e65e8fd7eb3 100644 --- a/core/modules/node/src/NodeTypeInterface.php +++ b/core/modules/node/src/NodeTypeInterface.php @@ -23,7 +23,7 @@ interface NodeTypeInterface extends ConfigEntityInterface { public function isLocked(); /** - * Returns whether a new revision should be created by default. + * Gets whether a new revision should be created by default. * * @return bool * TRUE if a new revision should be created by default. @@ -31,7 +31,7 @@ interface NodeTypeInterface extends ConfigEntityInterface { public function isNewRevision(); /** - * Set whether a new revision should be created by default. + * Sets whether a new revision should be created by default. * * @param bool $new_revision_ * TRUE if a new revision should be created by default. @@ -39,7 +39,7 @@ interface NodeTypeInterface extends ConfigEntityInterface { public function setNewRevision($new_revision); /** - * Returns whether 'Submitted by' information should be shown. + * Gets whether 'Submitted by' information should be shown. * * @return bool * TRUE if the submitted by information should be shown. @@ -47,7 +47,7 @@ interface NodeTypeInterface extends ConfigEntityInterface { public function displaySubmitted(); /** - * Set whether 'Submitted by' information should be shown. + * Sets whether 'Submitted by' information should be shown. * * @param bool $display_submitted * TRUE if the submitted by information should be shown. @@ -55,7 +55,7 @@ interface NodeTypeInterface extends ConfigEntityInterface { public function setDisplaySubmitted($display_submtited); /** - * Returns the preview mode. + * Gets the preview mode. * * @return int * DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED. @@ -71,7 +71,7 @@ interface NodeTypeInterface extends ConfigEntityInterface { public function setPreviewMode($preview_mode); /** - * Returns the help information. + * Gets the help information. * * @return string * The help information of this node type. @@ -79,7 +79,7 @@ interface NodeTypeInterface extends ConfigEntityInterface { public function getHelp(); /** - * Returns the description. + * Gets the description. * * @return string * The description of this node type. diff --git a/core/modules/node/src/Plugin/views/wizard/Node.php b/core/modules/node/src/Plugin/views/wizard/Node.php index deda7fe2ac8..ae8777bd0bf 100644 --- a/core/modules/node/src/Plugin/views/wizard/Node.php +++ b/core/modules/node/src/Plugin/views/wizard/Node.php @@ -48,6 +48,8 @@ class Node extends WizardPluginBase { * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::getAvailableSorts(). * * @return array + * An array whose keys are the available sort options and whose + * corresponding values are human readable labels. */ public function getAvailableSorts() { // You can't execute functions in properties, so override the method diff --git a/core/modules/node/src/Tests/NodeCreationTest.php b/core/modules/node/src/Tests/NodeCreationTest.php index 945012b5d95..7af3769eaef 100644 --- a/core/modules/node/src/Tests/NodeCreationTest.php +++ b/core/modules/node/src/Tests/NodeCreationTest.php @@ -190,9 +190,11 @@ class NodeCreationTest extends NodeTestBase { } /** - * Returns log records with the rollback exception message. + * Gets the watchdog IDs of the records with the rollback exception message. * - * @return array + * @return int[] + * Array containing the IDs of the log records with the rollback exception + * message. */ protected static function getWatchdogIdsForTestExceptionRollback() { // PostgreSQL doesn't support bytea LIKE queries, so we need to unserialize @@ -209,9 +211,11 @@ class NodeCreationTest extends NodeTestBase { } /** - * Returns log records with the explicit rollback failed exception message. + * Gets the log records with the explicit rollback failed exception message. * - * @return array + * @return \Drupal\Core\Database\StatementInterface + * A prepared statement object (already executed), which contains the log + * records with the explicit rollback failed exception message. */ protected static function getWatchdogIdsForFailedExplicitRollback() { return db_query("SELECT wid FROM {watchdog} WHERE message LIKE 'Explicit rollback failed%'")->fetchAll(); diff --git a/core/modules/node/src/Tests/NodeTestBase.php b/core/modules/node/src/Tests/NodeTestBase.php index 7d38bb5adcf..7b61e08209e 100644 --- a/core/modules/node/src/Tests/NodeTestBase.php +++ b/core/modules/node/src/Tests/NodeTestBase.php @@ -92,7 +92,7 @@ abstract class NodeTestBase extends WebTestBase { } /** - * Constructs an assert message for checking node access. + * Constructs an assert message to display which node access was tested. * * @param string $operation * The operation to check access for. @@ -103,6 +103,8 @@ abstract class NodeTestBase extends WebTestBase { * to check. If NULL, the untranslated (fallback) access is checked. * * @return string + * An assert message string which contains information in plain English + * about the node access permission test that was performed. */ function nodeAccessAssertMessage($operation, $result, $langcode = NULL) { return format_string(