diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php index a24a654e881bb82f51f32c98e76049ced7135a53..9e05b8cc1ed4e11c338f0570fac825ea6254f3bd 100644 --- a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php +++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php @@ -19,6 +19,9 @@ class StatisticsLastUpdated extends Date { // phpcs:ignore Drupal.NamingConventions.ValidVariableName.LowerCamelName, Drupal.Commenting.VariableComment.Missing protected ?string $node_table; + /** + * {@inheritdoc} + */ public function query() { $this->ensureMyTable(); $this->node_table = $this->query->ensureTable('node_field_data', $this->relationship); diff --git a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php index 5dd75072810cfec1aaa4af0dfb32c4240239a5ff..bf83b7067c52d32c19afcb0bd354387a027f7b12 100644 --- a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php @@ -69,6 +69,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$ } } + /** + * {@inheritdoc} + */ protected function defineOptions() { $options = parent::defineOptions(); @@ -124,6 +127,9 @@ public function query() { $this->addAdditionalFields(); } + /** + * {@inheritdoc} + */ public function preRender(&$values) { $vocabularies = $this->vocabularyStorage->loadMultiple(); $this->field_alias = $this->aliases['nid']; @@ -157,10 +163,16 @@ public function preRender(&$values) { } } + /** + * {@inheritdoc} + */ public function render_item($count, $item) { return $item['name']; } + /** + * {@inheritdoc} + */ protected function documentSelfTokens(&$tokens) { $tokens['{{ ' . $this->options['id'] . '__tid' . ' }}'] = $this->t('The taxonomy term ID for the term.'); $tokens['{{ ' . $this->options['id'] . '__name' . ' }}'] = $this->t('The taxonomy term name for the term.'); @@ -168,6 +180,9 @@ protected function documentSelfTokens(&$tokens) { $tokens['{{ ' . $this->options['id'] . '__vocabulary' . ' }}'] = $this->t('The name for the vocabulary the term belongs to.'); } + /** + * {@inheritdoc} + */ protected function addSelfTokens(&$tokens, $item) { foreach (['tid', 'name', 'vocabulary_vid', 'vocabulary'] as $token) { $tokens['{{ ' . $this->options['id'] . '__' . $token . ' }}'] = $item[$token] ?? ''; diff --git a/core/modules/user/src/Plugin/views/field/Permissions.php b/core/modules/user/src/Plugin/views/field/Permissions.php index 2e7041fcc0beaa1d77045224282d5f83871da5d4..6ae4d800b148612080cbffd36bd2db9083b1af89 100644 --- a/core/modules/user/src/Plugin/views/field/Permissions.php +++ b/core/modules/user/src/Plugin/views/field/Permissions.php @@ -75,11 +75,17 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$ $this->additional_fields['uid'] = ['table' => 'users_field_data', 'field' => 'uid']; } + /** + * {@inheritdoc} + */ public function query() { $this->addAdditionalFields(); $this->field_alias = $this->aliases['uid']; } + /** + * {@inheritdoc} + */ public function preRender(&$values) { $this->items = []; @@ -114,6 +120,9 @@ public function preRender(&$values) { } } + /** + * {@inheritdoc} + */ public function render_item($count, $item) { return $item['permission']; } diff --git a/core/modules/user/src/Plugin/views/field/Roles.php b/core/modules/user/src/Plugin/views/field/Roles.php index 13b487beb2e0e6592b084ae28da87e1396a645c5..096e161a3f9e524cf40cf5099666c1d399c784bf 100644 --- a/core/modules/user/src/Plugin/views/field/Roles.php +++ b/core/modules/user/src/Plugin/views/field/Roles.php @@ -59,11 +59,17 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$ $this->additional_fields['uid'] = ['table' => 'users_field_data', 'field' => 'uid']; } + /** + * {@inheritdoc} + */ public function query() { $this->addAdditionalFields(); $this->field_alias = $this->aliases['uid']; } + /** + * {@inheritdoc} + */ public function preRender(&$values) { $uids = []; $this->items = []; @@ -91,15 +97,24 @@ public function preRender(&$values) { } } + /** + * {@inheritdoc} + */ public function render_item($count, $item) { return $item['role']; } + /** + * {@inheritdoc} + */ protected function documentSelfTokens(&$tokens) { $tokens['{{ ' . $this->options['id'] . '__role' . ' }}'] = $this->t('The name of the role.'); $tokens['{{ ' . $this->options['id'] . '__rid' . ' }}'] = $this->t('The role machine-name of the role.'); } + /** + * {@inheritdoc} + */ protected function addSelfTokens(&$tokens, $item) { if (!empty($item['role'])) { $tokens['{{ ' . $this->options['id'] . '__role }}'] = $item['role']; diff --git a/core/modules/views/src/Plugin/views/HandlerBase.php b/core/modules/views/src/Plugin/views/HandlerBase.php index 7f40d5ec2a94ebe5c4bace1be898cfd7791e573c..00e22e3b5eae263b1a2995e28f748d60c3aa10b0 100644 --- a/core/modules/views/src/Plugin/views/HandlerBase.php +++ b/core/modules/views/src/Plugin/views/HandlerBase.php @@ -144,6 +144,9 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$ $this->query = &$view->query; } + /** + * {@inheritdoc} + */ protected function defineOptions() { $options = parent::defineOptions(); diff --git a/core/modules/views/src/Plugin/views/display/Attachment.php b/core/modules/views/src/Plugin/views/display/Attachment.php index c3978f4e4796c8a69a73fbb466a93f0395619cd1..6ab8d646abeb7651e1ce0114520755a59cebc23a 100644 --- a/core/modules/views/src/Plugin/views/display/Attachment.php +++ b/core/modules/views/src/Plugin/views/display/Attachment.php @@ -32,6 +32,9 @@ class Attachment extends DisplayPluginBase { */ protected $usesPager = FALSE; + /** + * {@inheritdoc} + */ protected function defineOptions() { $options = parent::defineOptions(); @@ -45,10 +48,16 @@ protected function defineOptions() { return $options; } + /** + * {@inheritdoc} + */ public function execute() { return $this->view->render($this->display['id']); } + /** + * Gets the positions for the attachment in relation to the parent display. + */ public function attachmentPositions($position = NULL) { $positions = [ 'before' => $this->t('Before'), @@ -296,6 +305,9 @@ public function displaysExposed() { return $this->options['inherit_exposed_filters'] ? FALSE : TRUE; } + /** + * {@inheritdoc} + */ public function renderPager() { return $this->usesPager() && $this->getOption('render_pager'); } diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php index d54d448b2ebb696c34e5a3216c80fd83bd1a8771..3a6edad4e6996bf326e22f64481915c2078e32e3 100644 --- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php +++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php @@ -463,6 +463,9 @@ public function defaultableSections($section = NULL) { } } + /** + * {@inheritdoc} + */ protected function defineOptions() { $options = [ 'defaults' => [ diff --git a/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php b/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php index 8a2d6c880d951875c235df6d7bc273580b879091..998b00045b9e889f45048c633ed3773b1cfffac6 100644 --- a/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php +++ b/core/modules/views/src/Plugin/views/exposed_form/InputRequired.php @@ -19,6 +19,9 @@ )] class InputRequired extends ExposedFormPluginBase { + /** + * {@inheritdoc} + */ protected function defineOptions() { $options = parent::defineOptions(); @@ -27,6 +30,9 @@ protected function defineOptions() { return $options; } + /** + * {@inheritdoc} + */ public function buildOptionsForm(&$form, FormStateInterface $form_state) { parent::buildOptionsForm($form, $form_state); @@ -40,6 +46,9 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) { ]; } + /** + * {@inheritdoc} + */ public function submitOptionsForm(&$form, FormStateInterface $form_state) { $exposed_form_options = $form_state->getValue('exposed_form_options'); $form_state->setValue(['exposed_form_options', 'text_input_required_format'], $exposed_form_options['text_input_required']['format']); @@ -47,6 +56,9 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) { parent::submitOptionsForm($form, $form_state); } + /** + * Indicates that the exposed filter has been applied. + */ protected function exposedFilterApplied() { static $cache = NULL; if (!isset($cache)) { @@ -68,6 +80,9 @@ protected function exposedFilterApplied() { return $cache; } + /** + * {@inheritdoc} + */ public function preRender($values) { // Display the "text on demand" if needed. This is a site builder-defined // text to display instead of results until the user selects and applies @@ -100,6 +115,9 @@ public function preRender($values) { } } + /** + * {@inheritdoc} + */ public function query() { if (!$this->exposedFilterApplied()) { // We return with no query; this will force the empty text. diff --git a/core/modules/views/src/Plugin/views/field/EntityField.php b/core/modules/views/src/Plugin/views/field/EntityField.php index 82630b4b4eac964fe50d35e6430099cda635b13d..8f389651ede04478423e0b2ddc74ecd55c15cc9a 100644 --- a/core/modules/views/src/Plugin/views/field/EntityField.php +++ b/core/modules/views/src/Plugin/views/field/EntityField.php @@ -714,6 +714,9 @@ public function buildGroupByForm(&$form, FormStateInterface $form_state) { ]; } + /** + * {@inheritdoc} + */ public function submitGroupByForm(&$form, FormStateInterface $form_state) { parent::submitGroupByForm($form, $form_state); $item = &$form_state->get('handler')->options; @@ -966,10 +969,16 @@ protected function createEntityForGroupBy(EntityInterface $entity, ResultRow $ro return $processed_entity; } + /** + * {@inheritdoc} + */ public function render_item($count, $item) { return $this->renderer->render($item['rendered']); } + /** + * {@inheritdoc} + */ protected function documentSelfTokens(&$tokens) { $field = $this->getFieldDefinition(); foreach ($field->getColumns() as $id => $column) { @@ -977,6 +986,9 @@ protected function documentSelfTokens(&$tokens) { } } + /** + * {@inheritdoc} + */ protected function addSelfTokens(&$tokens, $item) { $field = $this->getFieldDefinition(); foreach ($field->getColumns() as $id => $column) { diff --git a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php index c04abeccb1da603b3a09cfb76fe901d60b548ee2..a26b087fbd2e70a32c8c258d69a2b3a5b1210b7e 100644 --- a/core/modules/views/src/Plugin/views/field/FieldPluginBase.php +++ b/core/modules/views/src/Plugin/views/field/FieldPluginBase.php @@ -480,6 +480,9 @@ public function useStringGroupBy() { return TRUE; } + /** + * {@inheritdoc} + */ protected function defineOptions() { $options = parent::defineOptions(); @@ -1809,6 +1812,9 @@ public function theme(ResultRow $values) { return $output; } + /** + * {@inheritdoc} + */ public function themeFunctions() { $themes = []; $hook = 'views_view_field'; @@ -1835,6 +1841,9 @@ public function themeFunctions() { return $themes; } + /** + * {@inheritdoc} + */ public function adminLabel($short = FALSE) { return $this->getField(parent::adminLabel($short)); } diff --git a/core/modules/views/src/Plugin/views/field/MachineName.php b/core/modules/views/src/Plugin/views/field/MachineName.php index 698fa80a7202477a0a1cceba8db0c1c81fd04668..bd9b89bad9689d8fdbb404aa1f3d2c2401e8533b 100644 --- a/core/modules/views/src/Plugin/views/field/MachineName.php +++ b/core/modules/views/src/Plugin/views/field/MachineName.php @@ -25,6 +25,9 @@ class MachineName extends FieldPluginBase { */ protected $valueOptions; + /** + * {@inheritdoc} + */ public function getValueOptions() { if (isset($this->valueOptions)) { return; diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 076581a52edc533d49dd57e313a840ef7da35390..408b834d3370c0722f860a8b320efe568290da5f 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -75,6 +75,9 @@ <include-pattern>core/modules/*/Plugin/views/cache/*</include-pattern> <include-pattern>core/modules/*/Plugin/views/query/*</include-pattern> <include-pattern>core/modules/*/Plugin/views/sort/*</include-pattern> + <include-pattern>core/modules/*/Plugin/views/display/*</include-pattern> + <include-pattern>core/modules/*/Plugin/views/exposed_form/*</include-pattern> + <include-pattern>core/modules/*/Plugin/views/field/*</include-pattern> <exclude-pattern>*/tests/*</exclude-pattern> </rule> <rule ref="Drupal.Commenting.FunctionComment.MissingParamType">