From 18f8f32f70a3f76b307f4255eee0f51187b07283 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 7 Nov 2015 00:17:37 +0100 Subject: Fix security.context deprecation --- src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Wallabag/CoreBundle/Helper') 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 @@ namespace Wallabag\CoreBundle\Helper; use Liip\ThemeBundle\Helper\DeviceDetectionInterface; -use Symfony\Component\Security\Core\SecurityContextInterface; +use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Wallabag\UserBundle\Entity\User; /** @@ -14,16 +14,16 @@ use Wallabag\UserBundle\Entity\User; */ class DetectActiveTheme implements DeviceDetectionInterface { - protected $securityContext; + protected $tokenStorage; protected $defaultTheme; /** - * @param SecurityContextInterface $securityContext Needed to retrieve the current user + * @param TokenStorageInterface $tokenStorage Needed to retrieve the current user * @param string $defaultTheme Default theme when user isn't logged in */ - public function __construct(SecurityContextInterface $securityContext, $defaultTheme) + public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme) { - $this->securityContext = $securityContext; + $this->tokenStorage = $tokenStorage; $this->defaultTheme = $defaultTheme; } @@ -42,7 +42,7 @@ class DetectActiveTheme implements DeviceDetectionInterface */ public function getType() { - $token = $this->securityContext->getToken(); + $token = $this->tokenStorage->getToken(); if (is_null($token)) { return $this->defaultTheme; -- cgit v1.2.3 From 164d260c498a74b6b97a17dd63f9dd6088702ebc Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 7 Nov 2015 00:27:41 +0100 Subject: CS Also force SYMFONY_DEPRECATIONS_HELPER for travis --- src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/CoreBundle/Helper') diff --git a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php index 489f39d1..23e98042 100644 --- a/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php +++ b/src/Wallabag/CoreBundle/Helper/DetectActiveTheme.php @@ -18,8 +18,8 @@ class DetectActiveTheme implements DeviceDetectionInterface protected $defaultTheme; /** - * @param TokenStorageInterface $tokenStorage Needed to retrieve the current user - * @param string $defaultTheme Default theme when user isn't logged in + * @param TokenStorageInterface $tokenStorage Needed to retrieve the current user + * @param string $defaultTheme Default theme when user isn't logged in */ public function __construct(TokenStorageInterface $tokenStorage, $defaultTheme) { -- cgit v1.2.3