mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: Drop parameter names in Injector instantiation to preserve behaviour in PHP 8
Fixes #9667
This commit is contained in:
parent
e0f3797489
commit
622cf8b914
@ -20,6 +20,8 @@ class InjectionCreator implements Factory
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (count($params)) {
|
if (count($params)) {
|
||||||
|
// Remove named keys to ensure that PHP7 and PHP8 interpret these the same way
|
||||||
|
$params = array_values($params);
|
||||||
return $reflector->newInstanceArgs($params);
|
return $reflector->newInstanceArgs($params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,8 @@ abstract class PasswordEncryptor
|
|||||||
return new $class;
|
return new $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
$arguments = $encryptors[$algorithm];
|
// Don't treat array keys as argument names - keeps PHP 7 and PHP 8 operating similarly
|
||||||
|
$arguments = array_values($encryptors[$algorithm]);
|
||||||
return($refClass->newInstanceArgs($arguments));
|
return($refClass->newInstanceArgs($arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user