/** * Constructor. * * @param UserProviderInterface $userProvider A UserProviderInterface instance * @param AccountCheckerInterface $accountChecker An AccountCheckerInterface instance * @param PasswordEncoderInterface $passwordEncoder A PasswordEncoderInterface instance */ public function __construct(UserProviderInterface $userProvider, AccountCheckerInterface $accountChecker, PasswordEncoderInterface $passwordEncoder = null, $hideUserNotFoundExceptions = true) { parent::__construct($accountChecker, $hideUserNotFoundExceptions); if (null === $passwordEncoder) { $passwordEncoder = new PlaintextPasswordEncoder(); } $this->passwordEncoder = $passwordEncoder; $this->userProvider = $userProvider; }
/** * Constructor. * * @param UserProviderInterface $userProvider A UserProviderInterface instance * @param AccountCheckerInterface $accountChecker An AccountCheckerInterface instance * @param EncoderFactoryInterface $encoderFactory A EncoderFactoryInterface instance */ public function __construct(UserProviderInterface $userProvider, AccountCheckerInterface $accountChecker, EncoderFactoryInterface $encoderFactory, $hideUserNotFoundExceptions = true) { parent::__construct($accountChecker, $hideUserNotFoundExceptions); $this->encoderFactory = $encoderFactory; $this->userProvider = $userProvider; }