if ($rawConfig ?? null
) { $extrapasswordHashers =
array_map(function Dstring
$algo) use ($rawConfig): PasswordHasherInterface
{ $rawConfig['algorithm'
] =
$algo;
return $this->
createHasher($rawConfig);
},
['pbkdf2',
$rawConfig['hash_algorithm'
] ?? 'sha512'
]);
} else { $extrapasswordHashers =
[new Pbkdf2PasswordHasher(),
new MessageDigestPasswordHasher()];
} return new MigratingPasswordHasher($hasher, ...
$extrapasswordHashers);
} private function getHasherConfigFromAlgorithm(array
$config): array
{ if ('auto' ===
$config['algorithm'
]) { // "plaintext" is not listed as any leaked hashes could then be used to authenticate directly
if (SodiumPasswordHasher::
isSupported()) { $algorithms =
['native', 'sodium', 'pbkdf2'
];
} else { $algorithms =
['native', 'pbkdf2'
];
}