Problem/Motivation
On PHP 8.4, `ContentEntity::create()` triggers a deprecation warning:
> Implicitly marking parameter $migration as nullable is deprecated, the explicit nullable type must be used instead
This occurs at `src/Plugin/migrate/source/d8/ContentEntity.php` line 62.
Steps to reproduce
1. Run any migration using the `d8_entity` source plugin on PHP 8.4.
2. Observe the deprecation warning in the output.
Proposed resolution
Add the explicit nullable type indicator (`?`) to the `$migration` parameter:
// Before
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL) {
// After
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, ?MigrationInterface $migration = NULL) {
This is the only instance in the module. The deprecated subclass plugins (d8_node, d8_user, d8_file, d8_taxonomy_term) inherit from ContentEntity and do not override create().
Remaining tasks
Review and merge.
User interface changes
API changes
Data model changes
Issue fork migrate_drupal_d8-3573233
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
jlicht commentedComment #4
damienmckennaAdded the PHP 8.4 tag and adjusted some other metadata.
Comment #5
heddnThanks for the fixes here.