The module has some compatibility problems with PHP 8.1 which were identified in the Date module.
Date.DateMigrateTestCase
✗
include_once
exception: [Deprecated] Line 15 of sites/all/modules/migrate/includes/source.inc:
Return type of MigrateSource::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 15 of sites/all/modules/migrate/includes/source.inc:
Return type of MigrateSource::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 15 of sites/all/modules/migrate/includes/source.inc:
Return type of MigrateSource::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 15 of sites/all/modules/migrate/includes/source.inc:
Return type of MigrateSource::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 15 of sites/all/modules/migrate/includes/source.inc:
Return type of MigrateSource::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 864 of sites/all/modules/migrate/plugins/sources/xml.inc:
Return type of MigrateXMLReader::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 864 of sites/all/modules/migrate/plugins/sources/xml.inc:
Return type of MigrateXMLReader::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 864 of sites/all/modules/migrate/plugins/sources/xml.inc:
Return type of MigrateXMLReader::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 864 of sites/all/modules/migrate/plugins/sources/xml.inc:
Return type of MigrateXMLReader::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 864 of sites/all/modules/migrate/plugins/sources/xml.inc:
Return type of MigrateXMLReader::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 3567 of includes/bootstrap.inc:
Return type of MigrateSQLMap::current() should either be compatible with Iterator::current(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 3567 of includes/bootstrap.inc:
Return type of MigrateSQLMap::next() should either be compatible with Iterator::next(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 3567 of includes/bootstrap.inc:
Return type of MigrateSQLMap::key() should either be compatible with Iterator::key(): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 3567 of includes/bootstrap.inc:
Return type of MigrateSQLMap::valid() should either be compatible with Iterator::valid(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
exception: [Deprecated] Line 3567 of includes/bootstrap.inc:
Return type of MigrateSQLMap::rewind() should either be compatible with Iterator::rewind(): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
Comments
Comment #2
damienmckennaThis adds the #[\ReturnTypeWillChange] line before each of the affected methods.
Comment #3
joelpittetSome of the errors are fixed with #3253653: [PHP 8.0] ArgumentCountError: Too few arguments to function MigrationBase::errorHandler(), 4 passed and exactly 5 expected in MigrationBase->errorHandler() and these will help the date module tests to pass so RTBC as to keep the scope from duplicating fixes elsewhere.
Comment #4
cboyden commentedThis fix for 8.1 is causing PHPCS errors for PHP 7.4:
Attributes are not supported in PHP 7.4 or earlier. Found: #[\ReturnTypeWillChange]Comment #5
joelpittet@cboyden Maybe something wrong with the sniffer? Those should be treated as # comments in older versions of PHP.
Comment #6
avpadernoPHP 7.4 will ignore the attributes, but that is fine; the code will work fine with PHP 7.4.
Comment #7
cboyden commented@joelpittet this is the result when I run the dev version of PHPCompatibility, which is the only version that includes sniffs for PHP 8.x.
Comment #8
ronino commentedLOL, just submitted #3324432: PHP 8: Return type of MigrateSource::current() should either be compatible with Iterator::current(): mixed, or... and closed it as a duplicate shortly after. I guess we can't make the functions compatible as they need to work with PHP 5.3+. But this one works for me, too.
Comment #9
joseph.olstadComment #10
liam morland@cboyden #7 The sniffer has a bug. The attributes will be considered comment and the code will work.
@Ronino #8 What is stopping the code from working on all versions of PHO 5.3 and up? If that was the case, making the code compatible with PHP 8 is far more important than making it compatible with unsupported versions of PHP. Currently, the oldest version of PHP supported by the PHP community is PHP 8.0.
It would be helpful to enable automated tests on all supported versions of PHP: 8.0, 8.1, and 8.2.
Comment #11
joseph.olstadI sent requests for attention and offer to co-maintain to two of the three migrate module maintainers, the other, the first one has no contact form.
I will follow up with the request for co-maintainer/maintainer process.
Comment #12
damienmckennaComment #13
joseph.olstadComment #15
pifagor commentedComment #16
joseph.olstadhttps://www.drupal.org/project/migrate/releases/7.x-2.12