PHP

· Lars Nielsen

PHP Attributes in Drupal 11: Replacing Annotations in Plugins and Hooks

For years Drupal used docblock annotations — special comments parsed at runtime by the Doctrine Annotations library — to declare plugins, entity types, and field formatters. PHP 8.0 introduced native attributes as a first-class language feature, and Drupal 11 now supports them everywhere annotations were used.

Read article PHP Attributes in Drupal 11: Replacing Annotations in Plugins and Hooks
Subscribe to PHP