Compatibility with migrate_tools 6.x and PHP 8+ - MWDrushToolsCommands constructor signature mismatch

Created on 3 September 2025, about 1 month ago

Problem/Motivation

The migrate_wizard module is incompatible with the latest version of migrate_tools (6.x) and PHP 8+, causing fatal errors when running Drush commands.

Steps to reproduce

1. Install migrate_wizard 3.0.x with migrate_tools 6.x
2. Run any drush command (e.g., `drush status` or `drush deploy`)
3. Observe the fatal error

Actual result

PHP Fatal error: Declaration of Drupal\migrate_wizard\Drush\Commands\MWDrushToolsCommands::create(Symfony\Component\DependencyInjection\ContainerInterface $container): Drupal\migrate_wizard\Drush\Commands\MWDrushToolsCommands must be compatible with Drupal\migrate_tools\Drush\Commands\MigrateToolsCommands::create(Symfony\Component\DependencyInjection\ContainerInterface $container): static

Expected result

Drush commands should work without fatal errors.

Root cause

1. Return type mismatch: The `create()` method returns `self` instead of `static`
2. Constructor signature: Missing required dependencies for migrate_tools 6.x (TimeInterface, TranslationInterface, MigrationDrushCommandProgress)
3. Service configuration: `drush.services.yml` has outdated service arguments

Proposed resolution

Update the MWDrushToolsCommands class to be compatible with the latest migrate_tools module:

1. Change return type from `self` to `static` in the `create()` method
2. Add missing dependencies to constructor
3. Update service arguments in `drush.services.yml`

🐛 Bug report
Status

Active

Version

3.0

Component

Code

Created by

🇪🇸Spain whereiam

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

Comments & Activities

Production build 0.71.5 2024