When running migrations using the migrate_tools module, we are encountering the following deprecated function notices:
Deprecated function: Return type of Drupal\migrate_tools\IdMapFilter::accept() should either be compatible with FilterIterator::accept(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/docroot/modules/contrib/migrate_tools/src/IdMapFilter.php.
Deprecated function: Return type of Drupal\migrate_tools\SourceFilter::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /app/docroot/modules/contrib/migrate_tools/src/SourceFilter.php.
These deprecated notices are affecting the reliability and maintainability of our migration processes.
To address this issue, we propose the following steps:
Update the Drupal\migrate_tools\IdMapFilter::accept() function in /app/docroot/modules/contrib/migrate_tools/src/IdMapFilter.php to ensure its return type is compatible with FilterIterator::accept(): bool.
Update the Drupal\migrate_tools\SourceFilter::count() function in /app/docroot/modules/contrib/migrate_tools/src/SourceFilter.php to ensure its return type is compatible with Countable::count(): int.
Optionally, use the #[\ReturnTypeWillChange] attribute as a temporary measure to suppress the notices if making immediate changes to return types is not feasible.
These changes should resolve the deprecated function notices and improve the overall stability of the migrate_tools module.
There are no direct user interface changes associated with this issue.
The Drupal\migrate_tools\IdMapFilter::accept() function return type will change to be compatible with FilterIterator::accept(): bool.
The Drupal\migrate_tools\SourceFilter::count() function return type will change to be compatible with Countable::count(): int.
There are no data model changes associated with this issue.
Active
5.2
Code