Symfony2 API
Class

Symfony\Component\Security\Core\Encoder\EncoderFactory

class EncoderFactory implements EncoderFactoryInterface

A generic encoder factory implementation

Methods

__construct(array $encoders)

PasswordEncoderInterface getEncoder(UserInterface|string $user)

Returns the password encoder to use for the given account.

Details

at line 23
public __construct(array $encoders)

Parameters

array $encoders

at line 31
public PasswordEncoderInterface getEncoder(UserInterface|string $user)

Returns the password encoder to use for the given account.

Parameters

UserInterface|string $user A UserInterface instance or a class name

Return Value

PasswordEncoderInterface

Exceptions

RuntimeException when no password encoder could be found for the user