diff --git a/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php b/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php index b67cff227ec8..54f072c5c76f 100644 --- a/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php +++ b/core/modules/comment/src/Plugin/views/field/CommentBulkForm.php @@ -2,13 +2,13 @@ namespace Drupal\comment\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\BulkForm; /** * Defines a comment operations bulk form element. - * - * @ViewsField("comment_bulk_form") */ +#[ViewsField("comment_bulk_form")] class CommentBulkForm extends BulkForm { /** diff --git a/core/modules/comment/src/Plugin/views/field/CommentedEntity.php b/core/modules/comment/src/Plugin/views/field/CommentedEntity.php index 956bcc708928..0b00eeb40825 100644 --- a/core/modules/comment/src/Plugin/views/field/CommentedEntity.php +++ b/core/modules/comment/src/Plugin/views/field/CommentedEntity.php @@ -2,14 +2,14 @@ namespace Drupal\comment\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\EntityField; use Drupal\views\ResultRow; /** * Views field display for commented entity. - * - * @ViewsField("commented_entity") */ +#[ViewsField("commented_entity")] class CommentedEntity extends EntityField { /** diff --git a/core/modules/comment/src/Plugin/views/field/Depth.php b/core/modules/comment/src/Plugin/views/field/Depth.php index 48fbf432800b..ab7dc4761511 100644 --- a/core/modules/comment/src/Plugin/views/field/Depth.php +++ b/core/modules/comment/src/Plugin/views/field/Depth.php @@ -2,6 +2,7 @@ namespace Drupal\comment\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\EntityField; use Drupal\views\ResultRow; @@ -9,9 +10,8 @@ use Drupal\views\ResultRow; * Field handler to display the depth of a comment. * * @ingroup views_field_handlers - * - * @ViewsField("comment_depth") */ +#[ViewsField("comment_depth")] class Depth extends EntityField { /** diff --git a/core/modules/comment/src/Plugin/views/field/EntityLink.php b/core/modules/comment/src/Plugin/views/field/EntityLink.php index 6584f21318bd..7172918e1b85 100644 --- a/core/modules/comment/src/Plugin/views/field/EntityLink.php +++ b/core/modules/comment/src/Plugin/views/field/EntityLink.php @@ -3,6 +3,7 @@ namespace Drupal\comment\Plugin\views\field; use Drupal\Core\Form\FormStateInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; @@ -10,9 +11,8 @@ use Drupal\views\ResultRow; * Handler for showing comment module's entity links. * * @ingroup views_field_handlers - * - * @ViewsField("comment_entity_link") */ +#[ViewsField("comment_entity_link")] class EntityLink extends FieldPluginBase { /** diff --git a/core/modules/comment/src/Plugin/views/field/LastTimestamp.php b/core/modules/comment/src/Plugin/views/field/LastTimestamp.php index bbae18d54fdb..8110b79d3737 100644 --- a/core/modules/comment/src/Plugin/views/field/LastTimestamp.php +++ b/core/modules/comment/src/Plugin/views/field/LastTimestamp.php @@ -2,6 +2,7 @@ namespace Drupal\comment\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\Date; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ResultRow; @@ -11,9 +12,8 @@ use Drupal\views\ViewExecutable; * Field handler to display the timestamp of a comment with the count of comments. * * @ingroup views_field_handlers - * - * @ViewsField("comment_last_timestamp") */ +#[ViewsField("comment_last_timestamp")] class LastTimestamp extends Date { /** diff --git a/core/modules/comment/src/Plugin/views/field/LinkApprove.php b/core/modules/comment/src/Plugin/views/field/LinkApprove.php index 86687f52f0fb..0209400bc0bb 100644 --- a/core/modules/comment/src/Plugin/views/field/LinkApprove.php +++ b/core/modules/comment/src/Plugin/views/field/LinkApprove.php @@ -3,6 +3,7 @@ namespace Drupal\comment\Plugin\views\field; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\LinkBase; use Drupal\views\ResultRow; @@ -10,9 +11,8 @@ use Drupal\views\ResultRow; * Provides a comment approve link. * * @ingroup views_field_handlers - * - * @ViewsField("comment_link_approve") */ +#[ViewsField("comment_link_approve")] class LinkApprove extends LinkBase { /** diff --git a/core/modules/comment/src/Plugin/views/field/LinkReply.php b/core/modules/comment/src/Plugin/views/field/LinkReply.php index 816f341a6c70..9cfb082a669c 100644 --- a/core/modules/comment/src/Plugin/views/field/LinkReply.php +++ b/core/modules/comment/src/Plugin/views/field/LinkReply.php @@ -3,6 +3,7 @@ namespace Drupal\comment\Plugin\views\field; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\LinkBase; use Drupal\views\ResultRow; @@ -10,9 +11,8 @@ use Drupal\views\ResultRow; * Field handler to present a link to reply to a comment. * * @ingroup views_field_handlers - * - * @ViewsField("comment_link_reply") */ +#[ViewsField("comment_link_reply")] class LinkReply extends LinkBase { /** diff --git a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php index bb4dca48d97e..1ddcb16f4f77 100644 --- a/core/modules/comment/src/Plugin/views/field/NodeNewComments.php +++ b/core/modules/comment/src/Plugin/views/field/NodeNewComments.php @@ -8,6 +8,7 @@ use Drupal\Core\Entity\EntityFieldManagerInterface; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\node\Entity\Node; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\NumericField; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ResultRow; @@ -18,9 +19,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * Field handler to display the number of new comments. * * @ingroup views_field_handlers - * - * @ViewsField("node_new_comments") */ +#[ViewsField("node_new_comments")] class NodeNewComments extends NumericField { /** diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php index 58c3e16a6813..f6e270c358a0 100644 --- a/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php +++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastCommentName.php @@ -3,6 +3,7 @@ namespace Drupal\comment\Plugin\views\field; use Drupal\user\Entity\User; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; @@ -10,9 +11,8 @@ use Drupal\views\ResultRow; * Field handler to present the name of the last comment poster. * * @ingroup views_field_handlers - * - * @ViewsField("comment_ces_last_comment_name") */ +#[ViewsField("comment_ces_last_comment_name")] class StatisticsLastCommentName extends FieldPluginBase { /** diff --git a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php index 95b6cb733f2b..2662df44c018 100644 --- a/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php +++ b/core/modules/comment/src/Plugin/views/field/StatisticsLastUpdated.php @@ -2,15 +2,15 @@ namespace Drupal\comment\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\Date; /** * Field handler to display the newer of last comment / node updated. * * @ingroup views_field_handlers - * - * @ViewsField("comment_ces_last_updated") */ +#[ViewsField("comment_ces_last_updated")] class StatisticsLastUpdated extends Date { /** diff --git a/core/modules/contact/src/Plugin/views/field/ContactLink.php b/core/modules/contact/src/Plugin/views/field/ContactLink.php index af72aa3313de..eed47f0dd080 100644 --- a/core/modules/contact/src/Plugin/views/field/ContactLink.php +++ b/core/modules/contact/src/Plugin/views/field/ContactLink.php @@ -4,6 +4,7 @@ namespace Drupal\contact\Plugin\views\field; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\LinkBase; use Drupal\views\ResultRow; @@ -11,9 +12,8 @@ use Drupal\views\ResultRow; * Defines a field that links to the user contact page, if access is permitted. * * @ingroup views_field_handlers - * - * @ViewsField("contact_link") */ +#[ViewsField("contact_link")] class ContactLink extends LinkBase { /** diff --git a/core/modules/content_moderation/src/Plugin/views/field/ModerationStateField.php b/core/modules/content_moderation/src/Plugin/views/field/ModerationStateField.php index 42a477c296a6..4b4eea76b687 100644 --- a/core/modules/content_moderation/src/Plugin/views/field/ModerationStateField.php +++ b/core/modules/content_moderation/src/Plugin/views/field/ModerationStateField.php @@ -3,15 +3,15 @@ namespace Drupal\content_moderation\Plugin\views\field; use Drupal\content_moderation\Plugin\views\ModerationStateJoinViewsHandlerTrait; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\EntityField; /** * A field handler for the computed moderation_state field. * * @ingroup views_field_handlers - * - * @ViewsField("moderation_state_field") */ +#[ViewsField("moderation_state_field")] class ModerationStateField extends EntityField { use ModerationStateJoinViewsHandlerTrait; diff --git a/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php b/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php index 69d675ebb1fe..d52b81c748c7 100644 --- a/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php +++ b/core/modules/content_translation/src/Plugin/views/field/TranslationLink.php @@ -2,15 +2,15 @@ namespace Drupal\content_translation\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\EntityLink; /** * Provides a translation link for an entity. * * @ingroup views_field_handlers - * - * @ViewsField("content_translation_link") */ +#[ViewsField("content_translation_link")] class TranslationLink extends EntityLink { /** diff --git a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php index 338d5d704fce..a7308729917d 100644 --- a/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php +++ b/core/modules/contextual/src/Plugin/views/field/ContextualLinks.php @@ -8,6 +8,7 @@ use Drupal\Component\Utility\UrlHelper; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RedirectDestinationTrait; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; @@ -15,9 +16,8 @@ use Drupal\views\ResultRow; * Provides a handler that adds contextual links. * * @ingroup views_field_handlers - * - * @ViewsField("contextual_links") */ +#[ViewsField("contextual_links")] class ContextualLinks extends FieldPluginBase { use RedirectDestinationTrait; diff --git a/core/modules/dblog/src/Plugin/views/field/DblogMessage.php b/core/modules/dblog/src/Plugin/views/field/DblogMessage.php index fd18779f0465..5e80ea68f551 100644 --- a/core/modules/dblog/src/Plugin/views/field/DblogMessage.php +++ b/core/modules/dblog/src/Plugin/views/field/DblogMessage.php @@ -4,6 +4,7 @@ namespace Drupal\dblog\Plugin\views\field; use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Form\FormStateInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; @@ -13,9 +14,8 @@ use Drupal\views\Plugin\views\display\DisplayPluginBase; * Provides a field handler that renders a log event with replaced variables. * * @ingroup views_field_handlers - * - * @ViewsField("dblog_message") */ +#[ViewsField("dblog_message")] class DblogMessage extends FieldPluginBase { /** diff --git a/core/modules/dblog/src/Plugin/views/field/DblogOperations.php b/core/modules/dblog/src/Plugin/views/field/DblogOperations.php index 49a47fda8142..15fc0833746f 100644 --- a/core/modules/dblog/src/Plugin/views/field/DblogOperations.php +++ b/core/modules/dblog/src/Plugin/views/field/DblogOperations.php @@ -2,6 +2,7 @@ namespace Drupal\dblog\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; @@ -9,9 +10,8 @@ use Drupal\views\ResultRow; * Provides a field handler that renders operation link markup. * * @ingroup views_field_handlers - * - * @ViewsField("dblog_operations") */ +#[ViewsField("dblog_operations")] class DblogOperations extends FieldPluginBase { /** diff --git a/core/modules/file/src/Plugin/views/field/File.php b/core/modules/file/src/Plugin/views/field/File.php index e00d50d9cfa7..1002880d5fd9 100644 --- a/core/modules/file/src/Plugin/views/field/File.php +++ b/core/modules/file/src/Plugin/views/field/File.php @@ -4,6 +4,7 @@ namespace Drupal\file\Plugin\views\field; use Drupal\Core\File\FileUrlGeneratorInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\display\DisplayPluginBase; @@ -14,9 +15,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * Field handler to provide simple renderer that allows linking to a file. * * @ingroup views_field_handlers - * - * @ViewsField("file") */ +#[ViewsField("file")] class File extends FieldPluginBase { /** diff --git a/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php index 617cd23e12d5..5af925479d2a 100644 --- a/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php +++ b/core/modules/history/src/Plugin/views/field/HistoryUserTimestamp.php @@ -3,6 +3,7 @@ namespace Drupal\history\Plugin\views\field; use Drupal\Core\Form\FormStateInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\display\DisplayPluginBase; @@ -15,9 +16,8 @@ use Drupal\node\Plugin\views\field\Node; * table is history. * * @ingroup views_field_handlers - * - * @ViewsField("history_user_timestamp") */ +#[ViewsField("history_user_timestamp")] class HistoryUserTimestamp extends Node { /** diff --git a/core/modules/media_library/src/Plugin/views/field/MediaLibrarySelectForm.php b/core/modules/media_library/src/Plugin/views/field/MediaLibrarySelectForm.php index 64218f6345c1..203d1cda8909 100644 --- a/core/modules/media_library/src/Plugin/views/field/MediaLibrarySelectForm.php +++ b/core/modules/media_library/src/Plugin/views/field/MediaLibrarySelectForm.php @@ -9,6 +9,7 @@ use Drupal\Core\Form\FormBuilderInterface; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; use Drupal\media_library\MediaLibraryState; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\Render\ViewsRenderPipelineMarkup; use Drupal\views\ResultRow; @@ -17,11 +18,10 @@ use Symfony\Component\HttpFoundation\Request; /** * Defines a field that outputs a checkbox and form for selecting media. * - * @ViewsField("media_library_select_form") - * * @internal * Plugin classes are internal. */ +#[ViewsField("media_library_select_form")] class MediaLibrarySelectForm extends FieldPluginBase { /** diff --git a/core/modules/node/src/Plugin/views/field/Node.php b/core/modules/node/src/Plugin/views/field/Node.php index 94cb1a244191..2ab90944f644 100644 --- a/core/modules/node/src/Plugin/views/field/Node.php +++ b/core/modules/node/src/Plugin/views/field/Node.php @@ -4,6 +4,7 @@ namespace Drupal\node\Plugin\views\field; use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\ResultRow; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\display\DisplayPluginBase; @@ -17,9 +18,8 @@ use Drupal\views\Plugin\views\field\FieldPluginBase; * enabled by default. * * @ingroup views_field_handlers - * - * @ViewsField("node") */ +#[ViewsField("node")] class Node extends FieldPluginBase { /** diff --git a/core/modules/node/src/Plugin/views/field/NodeBulkForm.php b/core/modules/node/src/Plugin/views/field/NodeBulkForm.php index 4a6e219cceb3..aa205b7b2c45 100644 --- a/core/modules/node/src/Plugin/views/field/NodeBulkForm.php +++ b/core/modules/node/src/Plugin/views/field/NodeBulkForm.php @@ -2,13 +2,13 @@ namespace Drupal\node\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\BulkForm; /** * Defines a node operations bulk form element. - * - * @ViewsField("node_bulk_form") */ +#[ViewsField("node_bulk_form")] class NodeBulkForm extends BulkForm { /** diff --git a/core/modules/node/src/Plugin/views/field/RevisionLink.php b/core/modules/node/src/Plugin/views/field/RevisionLink.php index b1b981c607c7..4fa2a08a9ae1 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLink.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLink.php @@ -3,6 +3,7 @@ namespace Drupal\node\Plugin\views\field; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\LinkBase; use Drupal\views\ResultRow; @@ -10,9 +11,8 @@ use Drupal\views\ResultRow; * Field handler to present a link to a node revision. * * @ingroup views_field_handlers - * - * @ViewsField("node_revision_link") */ +#[ViewsField("node_revision_link")] class RevisionLink extends LinkBase { /** diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php index 8f92a2ee1b99..89d91783e17d 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkDelete.php @@ -3,15 +3,15 @@ namespace Drupal\node\Plugin\views\field; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\ResultRow; /** * Field handler to present link to delete a node revision. * * @ingroup views_field_handlers - * - * @ViewsField("node_revision_link_delete") */ +#[ViewsField("node_revision_link_delete")] class RevisionLinkDelete extends RevisionLink { /** diff --git a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php index 7c6c10f8b3c6..de53dc2d1a82 100644 --- a/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php +++ b/core/modules/node/src/Plugin/views/field/RevisionLinkRevert.php @@ -3,15 +3,15 @@ namespace Drupal\node\Plugin\views\field; use Drupal\Core\Url; +use Drupal\views\Attribute\ViewsField; use Drupal\views\ResultRow; /** * Field handler to present a link to revert a node to a revision. * * @ingroup views_field_handlers - * - * @ViewsField("node_revision_link_revert") */ +#[ViewsField("node_revision_link_revert")] class RevisionLinkRevert extends RevisionLink { /** diff --git a/core/modules/search/src/Plugin/views/field/Score.php b/core/modules/search/src/Plugin/views/field/Score.php index 643fcc45d4b8..453acac6d003 100644 --- a/core/modules/search/src/Plugin/views/field/Score.php +++ b/core/modules/search/src/Plugin/views/field/Score.php @@ -2,6 +2,7 @@ namespace Drupal\search\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\NumericField; use Drupal\views\ResultRow; @@ -9,9 +10,8 @@ use Drupal\views\ResultRow; * Field handler for search score. * * @ingroup views_field_handlers - * - * @ViewsField("search_score") */ +#[ViewsField("search_score")] class Score extends NumericField { /** diff --git a/core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php b/core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php index fb0eb3049e57..39dcc0150ecb 100644 --- a/core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php +++ b/core/modules/statistics/src/Plugin/views/field/NodeCounterTimestamp.php @@ -2,6 +2,7 @@ namespace Drupal\statistics\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\Date; use Drupal\Core\Session\AccountInterface; @@ -9,9 +10,8 @@ use Drupal\Core\Session\AccountInterface; * Field handler to display the most recent time the node has been viewed. * * @ingroup views_field_handlers - * - * @ViewsField("node_counter_timestamp") */ +#[ViewsField("node_counter_timestamp")] class NodeCounterTimestamp extends Date { /** diff --git a/core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php b/core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php index a425b31184b4..73c9092cd6a2 100644 --- a/core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php +++ b/core/modules/statistics/src/Plugin/views/field/StatisticsNumeric.php @@ -2,6 +2,7 @@ namespace Drupal\statistics\Plugin\views\field; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\NumericField; use Drupal\Core\Session\AccountInterface; @@ -9,9 +10,8 @@ use Drupal\Core\Session\AccountInterface; * Field handler to display numeric values from the statistics module. * * @ingroup views_field_handlers - * - * @ViewsField("statistics_numeric") */ +#[ViewsField("statistics_numeric")] class StatisticsNumeric extends NumericField { /** diff --git a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php index dc145a0e0fcb..c1a3c4fa082d 100644 --- a/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php +++ b/core/modules/taxonomy/src/Plugin/views/field/TaxonomyIndexTid.php @@ -3,6 +3,7 @@ namespace Drupal\taxonomy\Plugin\views\field; use Drupal\Core\Form\FormStateInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\Plugin\views\field\PrerenderList; @@ -13,9 +14,8 @@ use Drupal\taxonomy\VocabularyStorageInterface; * Field handler to display all taxonomy terms of a node. * * @ingroup views_field_handlers - * - * @ViewsField("taxonomy_index_tid") */ +#[ViewsField("taxonomy_index_tid")] class TaxonomyIndexTid extends PrerenderList { /** diff --git a/core/modules/taxonomy/src/Plugin/views/field/TermName.php b/core/modules/taxonomy/src/Plugin/views/field/TermName.php index 18c7f353b882..5f14a0428915 100644 --- a/core/modules/taxonomy/src/Plugin/views/field/TermName.php +++ b/core/modules/taxonomy/src/Plugin/views/field/TermName.php @@ -3,6 +3,7 @@ namespace Drupal\taxonomy\Plugin\views\field; use Drupal\Core\Form\FormStateInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\EntityField; use Drupal\views\ResultRow; @@ -10,9 +11,8 @@ use Drupal\views\ResultRow; * Displays taxonomy term names and allows converting spaces to hyphens. * * @ingroup views_field_handlers - * - * @ViewsField("term_name") */ +#[ViewsField("term_name")] class TermName extends EntityField { /** diff --git a/core/modules/user/src/Plugin/views/field/Permissions.php b/core/modules/user/src/Plugin/views/field/Permissions.php index c9b29a6e2d5b..cad795c7fa5c 100644 --- a/core/modules/user/src/Plugin/views/field/Permissions.php +++ b/core/modules/user/src/Plugin/views/field/Permissions.php @@ -4,6 +4,7 @@ namespace Drupal\user\Plugin\views\field; use Drupal\Core\Entity\EntityTypeManagerInterface; use Drupal\Core\Extension\ModuleHandlerInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\field\PrerenderList; @@ -13,9 +14,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * Field handler to provide a list of permissions. * * @ingroup views_field_handlers - * - * @ViewsField("user_permissions") */ +#[ViewsField("user_permissions")] class Permissions extends PrerenderList { /** diff --git a/core/modules/user/src/Plugin/views/field/Roles.php b/core/modules/user/src/Plugin/views/field/Roles.php index 2c7a7b00bd75..45124cd0f2a9 100644 --- a/core/modules/user/src/Plugin/views/field/Roles.php +++ b/core/modules/user/src/Plugin/views/field/Roles.php @@ -3,6 +3,7 @@ namespace Drupal\user\Plugin\views\field; use Drupal\Core\Database\Connection; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\display\DisplayPluginBase; use Drupal\views\ViewExecutable; use Drupal\views\Plugin\views\field\PrerenderList; @@ -13,9 +14,8 @@ use Drupal\user\Entity\Role; * Field handler to provide a list of roles. * * @ingroup views_field_handlers - * - * @ViewsField("user_roles") */ +#[ViewsField("user_roles")] class Roles extends PrerenderList { /** diff --git a/core/modules/user/src/Plugin/views/field/UserBulkForm.php b/core/modules/user/src/Plugin/views/field/UserBulkForm.php index 805df2b9e432..457a7a10d4f9 100644 --- a/core/modules/user/src/Plugin/views/field/UserBulkForm.php +++ b/core/modules/user/src/Plugin/views/field/UserBulkForm.php @@ -4,13 +4,13 @@ namespace Drupal\user\Plugin\views\field; use Drupal\Core\Form\FormStateInterface; use Drupal\user\UserInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\BulkForm; /** * Defines a user operations bulk form element. - * - * @ViewsField("user_bulk_form") */ +#[ViewsField("user_bulk_form")] class UserBulkForm extends BulkForm { /** diff --git a/core/modules/user/src/Plugin/views/field/UserData.php b/core/modules/user/src/Plugin/views/field/UserData.php index fb853cfc0a33..65743564b23e 100644 --- a/core/modules/user/src/Plugin/views/field/UserData.php +++ b/core/modules/user/src/Plugin/views/field/UserData.php @@ -5,6 +5,7 @@ namespace Drupal\user\Plugin\views\field; use Drupal\Core\Extension\ModuleExtensionList; use Drupal\Core\Extension\ModuleHandlerInterface; use Drupal\Core\Form\FormStateInterface; +use Drupal\views\Attribute\ViewsField; use Drupal\views\Plugin\views\field\FieldPluginBase; use Drupal\views\ResultRow; use Drupal\user\UserDataInterface; @@ -16,9 +17,8 @@ use Symfony\Component\DependencyInjection\ContainerInterface; * @ingroup views_field_handlers * * @see \Drupal\user\UserDataInterface - * - * @ViewsField("user_data") */ +#[ViewsField("user_data")] class UserData extends FieldPluginBase { /** diff --git a/core/modules/views/src/Attribute/ViewsField.php b/core/modules/views/src/Attribute/ViewsField.php new file mode 100644 index 000000000000..ff1387a05164 --- /dev/null +++ b/core/modules/views/src/Attribute/ViewsField.php @@ -0,0 +1,19 @@ +