aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2015-11-07 00:17:37 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2015-11-07 00:17:37 +0100
commit18f8f32f70a3f76b307f4255eee0f51187b07283 (patch)
tree0d81173a7e58dfff2e018327a60391e77292dfa8 /src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
parent5ead137fe6885395ffcc99903263dec235f2c051 (diff)
downloadwallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.tar.gz
wallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.tar.zst
wallabag-18f8f32f70a3f76b307f4255eee0f51187b07283.zip
Fix security.context deprecation
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php')
-rw-r--r--src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php12
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 @@
3namespace Wallabag\CoreBundle\Helper; 3namespace Wallabag\CoreBundle\Helper;
4 4
5use Liip\ThemeBundle\Helper\DeviceDetectionInterface; 5use Liip\ThemeBundle\Helper\DeviceDetectionInterface;
6use Symfony\Component\Security\Core\SecurityContextInterface; 6use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
7use Wallabag\UserBundle\Entity\User; 7use Wallabag\UserBundle\Entity\User;
8 8
9/** 9/**
@@ -14,16 +14,16 @@ use Wallabag\UserBundle\Entity\User;
14 */ 14 */
15class DetectActiveTheme implements DeviceDetectionInterface 15class 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;