Problem/Motivation
"core/modules/node/src/Plugin/migrate/source/d6/Node.php" "__construct" method uses variable of type "ModuleHandler" instead of "ModuleHandlerInterface".
This is the __construct definition:
public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityTypeManagerInterface $entity_type_manager, ModuleHandler $module_handler) {
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state, $entity_type_manager);
$this->moduleHandler = $module_handler;
}
This throws an error when e.g. decorating the module handler. See #3499285: Refactor to decorate ModuleHandler instead of HMIA, to make it work in Drupal 10 with Drush 13 in contrib for example.
Steps to reproduce
Proposed resolution
Use "ModuleHandlerInterface" instead.
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #3
grevil commentedSimple but effective change. Please review!
Comment #4
anybodyThanks @grevil, code-wise seems quite obvious that the Interface should be used! Guess it's simply old code?
Comment #5
anybodyComment #6
anybodyComment #7
anybodyComment #10
catchCommitted/pushed to 11.x and cherry-picked to 10.5.x, thanks!