diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-11-07 00:17:37 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-11-07 00:17:37 +0100 |
commit | 18f8f32f70a3f76b307f4255eee0f51187b07283 (patch) | |
tree | 0d81173a7e58dfff2e018327a60391e77292dfa8 /src/Wallabag/CoreBundle/Helper | |
parent | 5ead137fe6885395ffcc99903263dec235f2c051 (diff) | |
download | wallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.tar.gz wallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.tar.zst wallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.zip |
Fix security.context deprecation
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper')
-rw-r--r-- | src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php index 054a3752..489f39d1 100644 --- a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php +++ b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | |||
@@ -3,7 +3,7 @@ | |||
3 | namespace Wallabag\CoreBundle\Helper; | 3 | namespace Wallabag\CoreBundle\Helper; |
4 | 4 | ||
5 | use Liip\ThemeBundle\Helper\DeviceDetectionInterface; | 5 | use Liip\ThemeBundle\Helper\DeviceDetectionInterface; |
6 | use Symfony\Component\Security\Core\SecurityContextInterface; | 6 | use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; |
7 | use Wallabag\UserBundle\Entity\User; | 7 | use Wallabag\UserBundle\Entity\User; |
8 | 8 | ||
9 | /** | 9 | /** |
@@ -14,16 +14,16 @@ use Wallabag\UserBundle\Entity\User; | |||
14 | */ | 14 | */ |
15 | class DetectActiveTheme implements DeviceDetectionInterface | 15 | class DetectActiveTheme implements DeviceDetectionInterface |
16 | { | 16 | { |
17 | protected $securityContext; | 17 | protected $tokenStorage; |
18 | protected $defaultTheme; | 18 | protected $defaultTheme; |
19 | 19 | ||
20 | /** | 20 | /** |
21 | * @param SecurityContextInterface $securityContext Needed to retrieve the current user | 21 | * @param TokenStorageInterface $tokenStorage Needed to retrieve the current user |
22 | * @param string $defaultTheme Default theme when user isn't logged in | 22 | * @param string $defaultTheme Default theme when user isn't logged in |
23 | */ | 23 | */ |
24 | public function __construct(SecurityContextInterface $securityContext, $defaultTheme) | 24 | public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme) |
25 | { | 25 | { |
26 | $this->securityContext = $securityContext; | 26 | $this->tokenStorage = $tokenStorage; |
27 | $this->defaultTheme = $defaultTheme; | 27 | $this->defaultTheme = $defaultTheme; |
28 | } | 28 | } |
29 | 29 | ||
@@ -42,7 +42,7 @@ class DetectActiveTheme implements DeviceDetectionInterface | |||
42 | */ | 42 | */ |
43 | public function getType() | 43 | public function getType() |
44 | { | 44 | { |
45 | $token = $this->securityContext->getToken(); | 45 | $token = $this->tokenStorage->getToken(); |
46 | 46 | ||
47 | if (is_null($token)) { | 47 | if (is_null($token)) { |
48 | return $this->defaultTheme; | 48 | return $this->defaultTheme; |