Into Modern Standards: Drupalize.Me’s Transition from Annotations to PHP Attributes
Drupalize.Me is updating its extensive library of tutorials to reflect Drupal’s shift from PHP annotations to PHP attributes for plugin discovery. This significant transition, one of the largest updates since Drupal 8, impacts tutorials on the Plugin API, including blocks, field types, and views plugins. Joe Shindelar writes that the shift aligns with Drupal core's latest practices, though annotations will still be supported.
This comprehensive update involved over 30 tutorials where code examples were converted to attributes, along with the creation of new tutorials focused on PHP attributes. Approximately 25 additional tutorials were modified for consistency, and extensive testing was performed to maintain accuracy and prevent learner frustration. The update also extended to documentation on Drupal.org and the Examples for Developers project.
Future content updates are planned, such as on Drush commands and custom entity type declarations, emphasizing that documentation remains a continuous effort to keep pace with Drupal’s evolution.
Source Reference
Disclosure: This content is produced with the assistance of AI.