/var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Auth
Edit: /var/www/vhosts/ihelp.ro/httpdocs/vendor/cakephp/cakephp/src/Auth/PasswordHasherFactory.php (2059B)
|string $passwordHasher Name of the password hasher or an array with
* at least the key `className` set to the name of the class to use
* @return \Cake\Auth\AbstractPasswordHasher Password hasher instance
* @throws \RuntimeException If password hasher class not found or
* it does not extend {@link \Cake\Auth\AbstractPasswordHasher}
*/
public static function build($passwordHasher): AbstractPasswordHasher
{
$config = [];
if (is_string($passwordHasher)) {
$class = $passwordHasher;
} else {
$class = $passwordHasher['className'];
$config = $passwordHasher;
unset($config['className']);
}
$className = App::className($class, 'Auth', 'PasswordHasher');
if ($className === null) {
throw new RuntimeException(sprintf('Password hasher class "%s" was not found.', $class));
}
$hasher = new $className($config);
if (!($hasher instanceof AbstractPasswordHasher)) {
throw new RuntimeException('Password hasher must extend AbstractPasswordHasher class.');
}
return $hasher;
}
}