Issue #2472147 by googletorp, anavarre, jaredsmith, bojanz: Standardize getter docblocks in node module

8.0.x
xjm 2015-05-18 14:33:21 -07:00
parent a0164e04b8
commit 269f03db3f
8 changed files with 33 additions and 22 deletions

View File

@ -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 * @param EntityInterface $node
* The node being previewed. * The node being previewed.

View File

@ -18,7 +18,7 @@ use Drupal\user\UserInterface;
interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface { interface NodeInterface extends ContentEntityInterface, EntityChangedInterface, EntityOwnerInterface {
/** /**
* Returns the node type. * Gets the node type.
* *
* @return string * @return string
* The node type. * The node type.
@ -26,7 +26,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface,
public function getType(); public function getType();
/** /**
* Returns the node title. * Gets the node title.
* *
* @return string * @return string
* Title of the node. * Title of the node.
@ -45,7 +45,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface,
public function setTitle($title); public function setTitle($title);
/** /**
* Returns the node creation timestamp. * Gets the node creation timestamp.
* *
* @return int * @return int
* Creation timestamp of the node. * Creation timestamp of the node.
@ -123,7 +123,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface,
public function setPublished($published); public function setPublished($published);
/** /**
* Returns the node revision creation timestamp. * Gets the node revision creation timestamp.
* *
* @return int * @return int
* The UNIX timestamp of when this revision was created. * The UNIX timestamp of when this revision was created.
@ -142,7 +142,7 @@ interface NodeInterface extends ContentEntityInterface, EntityChangedInterface,
public function setRevisionCreationTime($timestamp); public function setRevisionCreationTime($timestamp);
/** /**
* Returns the node revision author. * Gets the node revision author.
* *
* @return \Drupal\user\UserInterface * @return \Drupal\user\UserInterface
* The user entity for the revision author. * The user entity for the revision author.

View File

@ -20,9 +20,10 @@ class NodePermissions {
use UrlGeneratorTrait; use UrlGeneratorTrait;
/** /**
* Returns an array of content permissions. * Gets an array of content permissions.
* *
* @return array * @return array
* The content permissions.
*/ */
public function contentPermissions() { public function contentPermissions() {
return array( return array(
@ -34,9 +35,11 @@ class NodePermissions {
} }
/** /**
* Returns an array of node type permissions. * Gets an array of node type permissions.
* *
* @return array * @return array
* The node type permissions.
* @see \Drupal\user\PermissionHandlerInterface::getPermissions()
*/ */
public function nodeTypePermissions() { public function nodeTypePermissions() {
$perms = array(); $perms = array();

View File

@ -17,7 +17,7 @@ use Drupal\Core\Session\AccountInterface;
interface NodeStorageInterface extends EntityStorageInterface { 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 * @param \Drupal\node\NodeInterface
* The node entity. * The node entity.
@ -28,7 +28,7 @@ interface NodeStorageInterface extends EntityStorageInterface {
public function revisionIds(NodeInterface $node); 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 * @param \Drupal\Core\Session\AccountInterface $account
* The user entity. * The user entity.

View File

@ -23,7 +23,7 @@ interface NodeTypeInterface extends ConfigEntityInterface {
public function isLocked(); 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 * @return bool
* TRUE if a new revision should be created by default. * TRUE if a new revision should be created by default.
@ -31,7 +31,7 @@ interface NodeTypeInterface extends ConfigEntityInterface {
public function isNewRevision(); 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_ * @param bool $new_revision_
* TRUE if a new revision should be created by default. * TRUE if a new revision should be created by default.
@ -39,7 +39,7 @@ interface NodeTypeInterface extends ConfigEntityInterface {
public function setNewRevision($new_revision); public function setNewRevision($new_revision);
/** /**
* Returns whether 'Submitted by' information should be shown. * Gets whether 'Submitted by' information should be shown.
* *
* @return bool * @return bool
* TRUE if the submitted by information should be shown. * TRUE if the submitted by information should be shown.
@ -47,7 +47,7 @@ interface NodeTypeInterface extends ConfigEntityInterface {
public function displaySubmitted(); public function displaySubmitted();
/** /**
* Set whether 'Submitted by' information should be shown. * Sets whether 'Submitted by' information should be shown.
* *
* @param bool $display_submitted * @param bool $display_submitted
* TRUE if the submitted by information should be shown. * TRUE if the submitted by information should be shown.
@ -55,7 +55,7 @@ interface NodeTypeInterface extends ConfigEntityInterface {
public function setDisplaySubmitted($display_submtited); public function setDisplaySubmitted($display_submtited);
/** /**
* Returns the preview mode. * Gets the preview mode.
* *
* @return int * @return int
* DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED. * DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED.
@ -71,7 +71,7 @@ interface NodeTypeInterface extends ConfigEntityInterface {
public function setPreviewMode($preview_mode); public function setPreviewMode($preview_mode);
/** /**
* Returns the help information. * Gets the help information.
* *
* @return string * @return string
* The help information of this node type. * The help information of this node type.
@ -79,7 +79,7 @@ interface NodeTypeInterface extends ConfigEntityInterface {
public function getHelp(); public function getHelp();
/** /**
* Returns the description. * Gets the description.
* *
* @return string * @return string
* The description of this node type. * The description of this node type.

View File

@ -48,6 +48,8 @@ class Node extends WizardPluginBase {
* Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::getAvailableSorts(). * Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::getAvailableSorts().
* *
* @return array * @return array
* An array whose keys are the available sort options and whose
* corresponding values are human readable labels.
*/ */
public function getAvailableSorts() { public function getAvailableSorts() {
// You can't execute functions in properties, so override the method // You can't execute functions in properties, so override the method

View File

@ -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() { protected static function getWatchdogIdsForTestExceptionRollback() {
// PostgreSQL doesn't support bytea LIKE queries, so we need to unserialize // 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() { protected static function getWatchdogIdsForFailedExplicitRollback() {
return db_query("SELECT wid FROM {watchdog} WHERE message LIKE 'Explicit rollback failed%'")->fetchAll(); return db_query("SELECT wid FROM {watchdog} WHERE message LIKE 'Explicit rollback failed%'")->fetchAll();

View File

@ -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 * @param string $operation
* The operation to check access for. * 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. * to check. If NULL, the untranslated (fallback) access is checked.
* *
* @return string * @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) { function nodeAccessAssertMessage($operation, $result, $langcode = NULL) {
return format_string( return format_string(