Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @see Symfony\Component\Security\Core\Encoder\EncoderFactory::getEncoder()
- */
- public function getEncoder(SecurityUserInterface $user)
- {
- if (!$user instanceof UserInterface) {
- return $this->genericFactory->getEncoder($user);
- }
- if (isset($this->encoders[$algorithm = $user->getAlgorithm()])) {
- return $this->encoders[$algorithm];
- }
- return $this->encoders[$algorithm] = $this->createEncoder($algorithm);
- }
- /**
- * @see Symfony\Component\Security\Core\Encoder\EncoderFactory::getEncoder()
- */
- public function getEncoder(SecurityUserInterface $user)
- {
- try {
- return $this->genericFactory->getEncoder($user);
- } catch (\RuntimeException $e) {
- if (isset($this->encoders[$algorithm = $user->getAlgorithm()])) {
- return $this->encoders[$algorithm];
- }
- return $this->encoders[$algorithm] = $this->createEncoder($algorithm);
- }
- }
Add Comment
Please, Sign In to add comment