mediatekformation

PasswordEncoderInterface

PasswordEncoderInterface is the interface for all encoders.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

encodePassword()  : string
Encodes the raw password.
isPasswordValid()  : bool
Checks a raw password against an encoded password.

Methods

encodePassword()

Encodes the raw password.

public encodePassword(string $raw, string|null $salt) : string
Parameters
$raw : string

The password to encode

$salt : string|null

The salt

Tags
throws
BadCredentialsException

If the raw password is invalid, e.g. excessively long

throws
InvalidArgumentException

If the salt is invalid

Return values
string

The encoded password

isPasswordValid()

Checks a raw password against an encoded password.

public isPasswordValid(string $encoded, string $raw, string|null $salt) : bool
Parameters
$encoded : string

An encoded password

$raw : string

A raw password

$salt : string|null

The salt

Tags
throws
InvalidArgumentException

If the salt is invalid

Return values
bool

true if the password is valid, false otherwise

Search results