Problem/Motivation

As of Drupal 10.2.0 we can use PHP attributes for plugin discovery. In 10.3/11.0 most core plugin types have been converted. PHP Attributes is now the recommended approach for plugin types. Change record: https://www.drupal.org/node/3395575

Proposed resolution

We should update the plugin_type_example module to use PHP Attributes and demonstrate the recommended best practice for defining new plugin types. I wrote the existing example code years ago while working on tutorials for Drupalize.Me and can take on these updates as well.

Issue fork examples-3479231

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

eojthebrave created an issue. See original summary.

eojthebrave’s picture

I believe the phpstan tests are failing here because #3463894: Update templates so 11.0 is the default/current branch is changing the GitLab CI default major version to Drupal 11. And Tour module was removed from Drupal 11.

avpaderno made their first commit to this issue’s fork.

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Active » Reviewed & tested by the community

Without the Tour Example module, tests are no longer failing.

Thank you for the merge request! I will merge it when I will be back to my computer, between two hours.

avpaderno’s picture

Title: Update plugin_type_example to use PHP attributes instead of annotations » Update Plugin Type Example to use PHP attributes instead of annotations
Assigned: avpaderno » Unassigned
Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.