diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Category.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Category.php index e42c0cae6ef182af72df0a2a739b4eee6ed0c010..05f77e12a4846a6f859a16f498b336ff9c94767f 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Category.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/Category.php @@ -59,11 +59,11 @@ public function buildOptionsForm(&$form, &$form_state) { * * @param string $data * The XSS safe string for the link text. - * @param object $values - * The values retrieved from the database. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. * - * @return data - * Returns string for the link text. + * @return string + * Returns a string for the link text. */ protected function renderLink($data, ResultRow $values) { $cid = $this->getValue($values, 'cid'); diff --git a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/TitleLink.php b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/TitleLink.php index b8d8508ac516d520ab45e6c80112433ba7c3b44d..27b5aa0e667a810a9fca63aa8f098d46f86309d4 100644 --- a/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/TitleLink.php +++ b/core/modules/aggregator/lib/Drupal/aggregator/Plugin/views/field/TitleLink.php @@ -68,11 +68,11 @@ public function render(ResultRow $values) { * * @param string $data * The XSS safe string for the link text. - * @param object $values - * The values retrieved from the database. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. * - * @return data - * Returns string for the link text. + * @return string + * Returns a string for the link text. */ protected function renderLink($data, ResultRow $values) { $link = $this->getValue($values, 'link'); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Comment.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Comment.php index a534175071564623909a7ae3e4a5c382a0e70636..1e12304ed1b041713f4354695b44619f0d419deb 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Comment.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Comment.php @@ -63,6 +63,17 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); } + /** + * Render whatever the data is as a link to the comment or its node. + * + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_comment'])) { $this->options['alter']['make_link'] = TRUE; diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php index 4231c3ba1f15a353d3a6c61934c9585f5a75d4c8..e2a0dd2bf49e505809f51ead53392d50c938053d 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Link.php @@ -90,6 +90,17 @@ public function render(ResultRow $values) { return $this->renderLink($comment, $values); } + /** + * Prepares the link pointing to the comment or its node. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The comment entity. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { $text = !empty($this->options['text']) ? $this->options['text'] : t('view'); $comment = $data; diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkApprove.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkApprove.php index e236b828177cabc68b0f3acf91c43b9e54aa0ba8..ae619714eba7f3e71eb47ecfc953feafed585c63 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkApprove.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkApprove.php @@ -24,6 +24,17 @@ public function access() { return user_access('administer comments'); } + /** + * Prepares the link pointing for approving the comment. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The comment entity. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { $status = $this->getValue($values, 'status'); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkDelete.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkDelete.php index 30cd273e3b4672765297926d34b37c796452e95f..34ba8ae7024d61069116eee7ddf634552ac69b62 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkDelete.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkDelete.php @@ -24,6 +24,17 @@ public function access() { return user_access('administer comments'); } + /** + * Prepares the link for deleting the comment. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The comment entity. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { $text = !empty($this->options['text']) ? $this->options['text'] : t('delete'); $comment = $this->getEntity($values); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkEdit.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkEdit.php index 805274bd47f49ec8d19e06f570a4516631db620c..39ce70d8b27eeb9be314ed0e7577f3a7905c1ee1 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkEdit.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkEdit.php @@ -37,6 +37,17 @@ public function buildOptionsForm(&$form, &$form_state) { ); } + /** + * Prepare the link for editing the comment. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The comment entity. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { parent::renderLink($data, $values); // Ensure user has access to edit this comment. diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkReply.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkReply.php index 6bdc7da51a60f5b470d904270de153e5b1bd99cd..9b1d212f72b05f2333777511cd13374aa4ded724 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkReply.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/LinkReply.php @@ -24,6 +24,17 @@ public function access() { return user_access('post comments'); } + /** + * Prepare the link for replying to the comment. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The comment entity. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { $text = !empty($this->options['text']) ? $this->options['text'] : t('reply'); $comment = $this->getEntity($values); diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php index d3f869f849689653ebd356a5b555f82ff0dd044e..3e36dfff2c234f37c9a5420fb68d962f932e9273 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/NodeNewComments.php @@ -127,6 +127,17 @@ public function preRender(&$values) { } } + /** + * Prepares the link to the first new comment. + * + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_comment']) && $data !== NULL && $data !== '') { $node = entity_create('node', array( diff --git a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Username.php b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Username.php index fc8275cabf4fe1e885f9f437ee95cdbea0bbb59e..9d63403a0c90acf9bd0940e117f4f0a596975518 100644 --- a/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Username.php +++ b/core/modules/comment/lib/Drupal/comment/Plugin/views/field/Username.php @@ -49,6 +49,17 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); } + /** + * Prepares link for the comment's author. + * + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_user'])) { $account = entity_create('user', array()); diff --git a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/views/field/TranslationLink.php b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/views/field/TranslationLink.php index 474e543900842f3863b22d09e6c2af5071d48415..733d7ab28bbf00941783628301b01e014c0469c4 100644 --- a/core/modules/content_translation/lib/Drupal/content_translation/Plugin/views/field/TranslationLink.php +++ b/core/modules/content_translation/lib/Drupal/content_translation/Plugin/views/field/TranslationLink.php @@ -54,11 +54,11 @@ public function render(ResultRow $values) { * * @param \Drupal\Core\Entity\EntityInterface $entity * The entity being rendered. - * @param \stdClass $values + * @param \Drupal\views\ResultRow $values * The current row of the views result. * * @return string - * The acutal rendered text (without the link) of this field. + * The actual rendered text (without the link) of this field. */ protected function renderLink(EntityInterface $entity, ResultRow $values) { if (content_translation_translate_access($entity)) { diff --git a/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php index 30de8f975461c7e7217fd51fcf69e0f80e578cd7..ec7a3a6011c834b50357d9e944774e76fb02574a 100644 --- a/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php +++ b/core/modules/contextual/lib/Drupal/contextual/Plugin/views/field/ContextualLinks.php @@ -68,6 +68,9 @@ public function preRender(&$values) { * * Renders the contextual fields. * + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * * @see contextual_preprocess() * @see contextual_contextual_links_view_alter() */ diff --git a/core/modules/file/lib/Drupal/file/Plugin/views/field/File.php b/core/modules/file/lib/Drupal/file/Plugin/views/field/File.php index df5056f1d5ab8ad9f5123e70819c8aa964eb50c7..3f28bd84c8647701a64423ea22d69526d0f6af23 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/views/field/File.php +++ b/core/modules/file/lib/Drupal/file/Plugin/views/field/File.php @@ -53,9 +53,15 @@ public function buildOptionsForm(&$form, &$form_state) { } /** - * Render whatever the data is as a link to the file. + * Prepares link to the file. * - * Data should be made XSS safe prior to calling this function. + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_file']) && $data !== NULL && $data !== '') { diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php index a4715a8a6ea6d0bff62116953ef30ff8248d9721..18a9a9a16e8d1ac8dbd0ca50a9bb318d53f946ce 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Link.php @@ -55,6 +55,17 @@ public function render(ResultRow $values) { } } + /** + * Prepares the link to the node. + * + * @param \Drupal\Core\Entity\EntityInterface $node + * The node entity this field belongs to. + * @param ResultRow $values + * The values retrieved from the view's result set. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($node, ResultRow $values) { if (node_access('view', $node)) { $this->options['alter']['make_link'] = TRUE; diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php index 4a60a4bc87006f8c2ff2348ce3a24f12cad81265..ed04c4fffc54b2305cda4410764066ae9c24f4fc 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkDelete.php @@ -21,7 +21,15 @@ class LinkDelete extends Link { /** - * Renders the link. + * Prepares the link to delete a node. + * + * @param \Drupal\Core\Entity\EntityInterface $node + * The node entity this field belongs to. + * @param \Drupal\views\ResultRow $values + * The values retrieved from the view's result set. + * + * @return string + * Returns a string for the link text. */ protected function renderLink($node, ResultRow $values) { // Ensure user has access to delete this node. diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkEdit.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkEdit.php index fdf933e087049c9d54f4b6df27249aa10c1fe295..9dbc9ac7aa19e771b851437647a89e3ec66978e8 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkEdit.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/LinkEdit.php @@ -21,7 +21,15 @@ class LinkEdit extends Link { /** - * Renders the link. + * Prepares the link to the node. + * + * @param \Drupal\Core\Entity\EntityInterface $node + * The node entity this field belongs to. + * @param ResultRow $values + * The values retrieved from the view's result set. + * + * @return string + * Returns a string for the link text. */ protected function renderLink($node, ResultRow $values) { // Ensure user has access to edit this node. diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php index a8e479469f312b9e3e7286ec606dfcefbcfb72a9..b2de15a2c64ce5d2e9e9aa4fef581d1602bc0224 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Node.php @@ -57,9 +57,15 @@ public function buildOptionsForm(&$form, &$form_state) { } /** - * Render whatever the data is as a link to the node. + * Prepares link to the node. * - * Data should be made XSS safe prior to calling this function. + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_node']) && !empty($this->additional_fields['nid'])) { diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php index 4a884b4dce0d4772444f150fc76766bb939d17e3..f99f6b7356c1dc26b53a0a406da72c3f72a97e41 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/Revision.php @@ -53,9 +53,15 @@ public function buildOptionsForm(&$form, &$form_state) { } /** - * Render whatever the data is as a link to the node. + * Prepares link to the node revision. * - * Data should be made XSS safe prior to calling this function. + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_node_revision']) && $data !== NULL && $data !== '') { diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php index 0bc8d15dd110f024a86d6d1d8ae2546e3f29cc65..f56388bf89c340c30e9496c2215144361f551fae 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLink.php @@ -35,6 +35,17 @@ public function access() { return user_access('view revisions') || user_access('administer nodes'); } + /** + * Prepares the link to point to a node revision. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The node revision entity this field belongs to. + * @param \Drupal\views\ResultRow $values + * The values retrieved from the view's result set. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { list($node, $vid) = $this->get_revision_entity($values, 'view'); if (!isset($vid)) { diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php index 306b5ba75dfe2b1e4c366820531696cb165aa01e..0f8cc641e7b6223ec933fa705e95d39fdff8cfb0 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkDelete.php @@ -24,6 +24,17 @@ public function access() { return user_access('delete revisions') || user_access('administer nodes'); } + /** + * Prepares the link to delete a node revision. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The node revision entity this field belongs to. + * @param \Drupal\views\ResultRow $values + * The values retrieved from the view's result set. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { list($node, $vid) = $this->get_revision_entity($values, 'delete'); if (!isset($vid)) { diff --git a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php index 6318bd43965a2885941b944e26c137d7e814e482..13c10fd4cf46c7ba95289c9ed7335d25c6eceb55 100644 --- a/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php +++ b/core/modules/node/lib/Drupal/node/Plugin/views/field/RevisionLinkRevert.php @@ -24,6 +24,17 @@ public function access() { return user_access('revert revisions') || user_access('administer nodes'); } + /** + * Prepares the link to revert node to a revision. + * + * @param \Drupal\Core\Entity\EntityInterface $data + * The node revision entity this field belongs to. + * @param \Drupal\views\ResultRow $values + * The values retrieved from the view's result set. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { list($node, $vid) = $this->get_revision_entity($values, 'update'); if (!isset($vid)) { diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/Taxonomy.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/Taxonomy.php index b2ff458c5c43d85434f597900b164536b1b6cce9..be01032bc2b4b87cba3eb49649bb77c5324de39b 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/Taxonomy.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/views/field/Taxonomy.php @@ -66,9 +66,15 @@ public function buildOptionsForm(&$form, &$form_state) { } /** - * Render whatever the data is as a link to the taxonomy. + * Prepares a link to the taxonomy. * - * Data should be made XSS safe prior to calling this function. + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. */ protected function renderLink($data, ResultRow $values) { $tid = $this->getValue($values, 'tid'); diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Language.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Language.php index 3ea7d45f68b0f719a48db3140ffb77f9bbfd0699..46c758006b4b1f365b6d2a384f1fae9839171825 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Language.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Language.php @@ -19,6 +19,9 @@ */ class Language extends User { + /** + * {@inheritdoc} + */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_user'])) { $uid = $this->getValue($values, 'uid'); diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php index 390bfc4fabaed77d48e43d733fe15cfd5788190f..eaf785ec44ebf985de49394f6fe24643d749d394 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Link.php @@ -68,7 +68,7 @@ public function render(ResultRow $values) { * Alters the field to render a link. * * @param \Drupal\Core\Entity\EntityInterface $entity - * @param \stdClass $values + * @param \Drupal\views\ResultRow $values * The current row of the views result. * * @return string diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Mail.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Mail.php index 9fce78433a6279f15cccbc54a7df9f4641dcda9f..1520359e87728333fbc210b4bd653c62117dceb9 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Mail.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Mail.php @@ -39,6 +39,9 @@ public function buildOptionsForm(&$form, &$form_state) { ); } + /** + * {@inheritdoc} + */ protected function renderLink($data, ResultRow $values) { parent::renderLink($data, $values); diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php index 50e580ba8079121590a2f9286218eeca0acd122e..fb374ba3347267a57b529f36c1f6dd331a66e7d8 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/Name.php @@ -75,6 +75,9 @@ public function buildOptionsForm(&$form, &$form_state) { ); } + /** + * {@inheritdoc} + */ protected function renderLink($data, ResultRow $values) { $account = entity_create('user', array()); $account->uid = $this->getValue($values, 'uid'); diff --git a/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php b/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php index bb7e861dc48040a9b255193c2bc7d691c8af0921..159b4aa1d8558068066bb51e703f4bb70922894d 100644 --- a/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php +++ b/core/modules/user/lib/Drupal/user/Plugin/views/field/User.php @@ -52,6 +52,17 @@ public function buildOptionsForm(&$form, &$form_state) { parent::buildOptionsForm($form, $form_state); } + /** + * Prepares a link to the user. + * + * @param string $data + * The XSS safe string for the link text. + * @param \Drupal\views\ResultRow $values + * The values retrieved from a single row of a view's query result. + * + * @return string + * Returns a string for the link text. + */ protected function renderLink($data, ResultRow $values) { if (!empty($this->options['link_to_user']) && user_access('access user profiles') && ($entity = $this->getEntity($values)) && $data !== NULL && $data !== '') { $this->options['alter']['make_link'] = TRUE; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php index 15b041c7d055043b7e18b41f73a0fb07ea63a568..50e47e2ab3df37f86841bdd4a915f0eca68761b0 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/Counter.php @@ -8,6 +8,7 @@ namespace Drupal\views\Plugin\views\field; use Drupal\Component\Annotation\PluginID; +use Drupal\views\ResultRow; /** * Field handler to show a counter of the current row. @@ -43,7 +44,7 @@ public function query() { /** * {@inheritdoc} */ - public function getValue($values, $field = NULL) { + public function getValue(ResultRow $values, $field = NULL) { // Note: 1 is subtracted from the counter start value below because the // counter value is incremented by 1 at the end of this function. $count = is_numeric($this->options['counter_start']) ? $this->options['counter_start'] - 1 : 0; diff --git a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php index 25c28a868feb0efdc057afbe50e1302f82953ef8..1f8264e5198374cc56c6979e513f728ae2d80749 100644 --- a/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/lib/Drupal/views/Plugin/views/field/FieldPluginBase.php @@ -384,12 +384,12 @@ public function getEntity(ResultRow $values) { * This api exists so that other modules can easy set the values of the field * without having the need to change the render method as well. * - * @param $values + * @param \Drupal\views\ResultRow $values * An object containing all retrieved values. - * @param $field + * @param string $field * Optional name of the field where the value is stored. */ - public function getValue($values, $field = NULL) { + public function getValue(ResultRow $values, $field = NULL) { $alias = isset($field) ? $this->aliases[$field] : $this->field_alias; if (isset($values->{$alias})) { return $values->{$alias}; @@ -1096,7 +1096,7 @@ public function preRender(&$values) { } * Renders the field. * * @param \Drupal\views\ResultRow $values - * The values retrieved from the database. + * The values retrieved from a single row of a view's query result. */ public function render(ResultRow $values) { $value = $this->getValue($values); @@ -1110,7 +1110,7 @@ public function render(ResultRow $values) { * text-replacement rendering is necessary. * * @param \Drupal\views\ResultRow $values - * The values retrieved from the database. + * The values retrieved from a single row of a view's query result. */ public function advancedRender(ResultRow $values) { if ($this->allowAdvancedRender() && method_exists($this, 'render_item')) { @@ -1591,8 +1591,14 @@ protected function documentSelfTokens(&$tokens) { } /** * Call out to the theme() function, which probably just calls render() but * allows sites to override output fairly easily. + * + * @param \Drupal\views\ResultRow $values + * Holds single row of a view's result set. + * + * @return string|false + * Returns rendered output of the given theme implementation. */ - function theme($values) { + function theme(ResultRow $values) { return theme($this->themeFunctions(), array( 'view' => $this->view,