Convert menu_migration plugins and plugin managers to use PHP Attributes instead of Annotations

Created on 15 July 2024, 5 months ago

System information

  • Drupal Core Version: ^10.2 || ^11
  • Menu Migration Version: 4.0.0-alpha1
  • PHP Version: >=8.1 & <=8.3

Problem/Motivation

With the introduction of Plugin implementations should use PHP attributes instead of annotations and Plugin types should use PHP attributes instead of annotations in Drupal Core 10.2.0, convert the existing plugin managers, plugin annotation and plugin definitions to use PHP Attributes.

Proposed resolution

The following attributes should be created:

src/Attribute/MenuMigrationDestination.php
src/Attribute/MenuMigrationFormat.php
src/Attribute/MenuMigrationSource.php

The following existing plugins should be converted:

src/Plugin/menu_migration/ExportDestination/Codebase.php
src/Plugin/menu_migration/ExportDestination/Download.php
src/Plugin/menu_migration/Format/JsonFormat.php
src/Plugin/menu_migration/ImportSource/Codebase.php
src/Plugin/menu_migration/ImportSource/FileUpload.php

The following plugin managers should be updated:

src/Plugin/ExportDestinationManager.php
src/Plugin/FormatManager.php
src/Plugin/ImportSourceManager.php

Left to do

Since the version 4.x is a recent one, and the usages are low, decide if we completely drop support for annotations or if we keep them for backwards compatibility.

📌 Task
Status

Active

Version

4.0

Component

Code

Created by

🇷🇴Romania bbu23

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024