-
Notifications
You must be signed in to change notification settings - Fork 146
Fix PHP 8.1 return type deprecation errors #865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think my first proposal is not correct, as it may break classes that extends modified classes. Indeed, their method signature may differ and it will result in a fatal error. I propose to use the |
Honestly, it's why I need time to check it ;) Using a two steps process, could indeed be the right path to make it properly done. If you see some other element to break feel free to prepare it for a V5 ;) |
I've updated this PR to prevent BR breaks. Explicit return types will be required for PHP 9.0 compatibility, so it can be done later :). |
Hi @cedric-anne, |
Hi @villfa I think all of them are fixed now. I executed this simple script in atoum roor dir to detect them: spl_autoload_register(
function ($class) {
if (!preg_match('/^atoum\\\\/', $class)) {
return;
}
include 'classes/' . implode('/', explode('\\', preg_replace('/^atoum\\\\atoum\\\\/', '', $class))) . '.php';
}
);
$dir_iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator(__DIR__ . '/classes'),
RecursiveIteratorIterator::SELF_FIRST
);
foreach ($dir_iterator as $file) {
if ($file->getExtension() !== 'php') {
continue;
}
require_once $file->getRealPath();
} |
Segfault is still present :/. |
Fixes
ArrayAccess
,Countable
andIteratorAggregate
implementations.It removes the fluent logic on
ArrayAccess
implementations, so it may introduce BC breaks.