Drupal Migrate Plus 6.0.9 Requires PHP Attributes Over Annotations
Drupal’s migrate_plus module has adopted native PHP attributes for plugin metadata, formally deprecating Doctrine-style annotations as of version 6.0.9. While this marks a significant API shift for migration plugin developers, a recent disruption affecting plugin discovery was not caused by the attribute transition itself, but rather by a syntax error in the DataParserPluginManager class. This bug, tracked in issue #3565462, was not yet resolved in 6.0.9, leading some teams to mistakenly associate the breakage with the version update.
The broader transition from annotations to attributes aligns with Drupal’s ongoing adoption of PHP 8.1+ language features. Unlike annotations, which rely on comment-based docblocks, PHP attributes are native constructs that offer improved runtime performance, type safety, and IDE support.
According to Steffen Rühlmann of undpaul, the move away from the doctrine/annotations library was necessary. With that library no longer actively maintained and relying on runtime parsing, switching to attributes introduces a more robust and future-proof model for plugin discovery.
Steffen provides guidance for developers migrating custom plugins, including replacing annotation blocks with attribute syntax and importing necessary classes such as DataParser. Developers are encouraged to update entire migration plugin sets simultaneously to avoid inconsistent behavior.
However, the temporary plugin discovery failure reported by some users was due to an unresolved syntax error introduced in the DataParserPluginManager, not the switch to PHP attributes. As Steffen noted, their team initially attributed the issue to the migrate_plus 6.0.9 update, when in fact the root cause was a bug that had not yet been merged at the time of release.
While migrate_plus 6.0.9 enforces exclusive use of PHP attributes for plugin definitions, Drupal core itself continues to support both annotations and attributes. Developers relying on annotation-based plugins should begin migrating, but must also ensure the fix for issue #3565462 is applied to avoid plugin discovery issues.
To check whether your site is affected, update to migrate_plus 6.0.9 and run drush migrate:status. If plugins disappear or errors occur, confirm that the syntax patch from issue #3565462 is in place. Begin migrating plugin definitions to PHP attributes to maintain compatibility and ensure stable behavior.
