From 75e9d1df03831a3dc1f92b0ef713c5e2f90fa543 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 2 Jun 2015 16:58:19 +0200 Subject: Update to Symfony 2.7 And fix some deps instead of using dev tags --- .../Security/Validator/WallabagUserPasswordValidator.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/Wallabag/CoreBundle/Security') diff --git a/src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php b/src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php index 5586f976..52062773 100644 --- a/src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php +++ b/src/Wallabag/CoreBundle/Security/Validator/WallabagUserPasswordValidator.php @@ -3,7 +3,7 @@ namespace Wallabag\CoreBundle\Security\Validator; use Symfony\Component\Security\Core\User\UserInterface; -use Symfony\Component\Security\Core\SecurityContextInterface; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Encoder\EncoderFactoryInterface; use Symfony\Component\Validator\Constraint; use Symfony\Component\Validator\ConstraintValidator; @@ -11,14 +11,17 @@ use Symfony\Component\Validator\Exception\ConstraintDefinitionException; use Symfony\Component\Validator\Exception\UnexpectedTypeException; use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; +/** + * @see Symfony\Component\Security\Core\Validator\Constraints\UserPasswordValidator + */ class WallabagUserPasswordValidator extends ConstraintValidator { private $securityContext; private $encoderFactory; - public function __construct(SecurityContextInterface $securityContext, EncoderFactoryInterface $encoderFactory) + public function __construct(TokenStorageInterface $tokenStorage, EncoderFactoryInterface $encoderFactory) { - $this->securityContext = $securityContext; + $this->tokenStorage = $tokenStorage; $this->encoderFactory = $encoderFactory; } @@ -31,7 +34,7 @@ class WallabagUserPasswordValidator extends ConstraintValidator throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\UserPassword'); } - $user = $this->securityContext->getToken()->getUser(); + $user = $this->tokenStorage->getToken()->getUser(); if (!$user instanceof UserInterface) { throw new ConstraintDefinitionException('The User object must implement the UserInterface interface.'); -- cgit v1.2.3