aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2015-11-07 13:39:30 +0100
committerNicolas Lœuillet <nicolas@loeuillet.org>2015-11-07 13:39:30 +0100
commit4529d0f4b6b20cbbd1ccb5339a753aff7d35552b (patch)
tree84724eea1cef0c6d44afbb850d939367921a230c /src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
parent3d9ccf9390f35e73428ebf42258253c6808f1590 (diff)
parent164d260c498a74b6b97a17dd63f9dd6088702ebc (diff)
downloadwallabag-4529d0f4b6b20cbbd1ccb5339a753aff7d35552b.tar.gz
wallabag-4529d0f4b6b20cbbd1ccb5339a753aff7d35552b.tar.zst
wallabag-4529d0f4b6b20cbbd1ccb5339a753aff7d35552b.zip
Merge pull request #1510 from wallabag/v2-sf3
v2 – Fix some deprecated for Symfony3
Diffstat (limited to 'src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php')
-rw-r--r--src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php
index 054a3752..23e98042 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;