EncoderFactoryInterface.php 881 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Security\Core\Encoder;
  11. use Symfony\Component\Security\Core\User\UserInterface;
  12. /**
  13. * EncoderFactoryInterface to support different encoders for different accounts.
  14. *
  15. * @author Johannes M. Schmitt <schmittjoh@gmail.com>
  16. */
  17. interface EncoderFactoryInterface
  18. {
  19. /**
  20. * Returns the password encoder to use for the given account.
  21. *
  22. * @param UserInterface|string $user A UserInterface instance or a class name
  23. *
  24. * @return PasswordEncoderInterface
  25. *
  26. * @throws \RuntimeException when no password encoder could be found for the user
  27. */
  28. public function getEncoder($user);
  29. }