diff options
-rw-r--r-- | Core/SecurityContext.php | 8 | ||||
-rw-r--r-- | Core/SecurityContextInterface.php | 2 | ||||
-rw-r--r-- | Tests/Core/LegacySecurityContextInterfaceTest.php | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/Core/SecurityContext.php b/Core/SecurityContext.php index 165c22a..7edea64 100644 --- a/Core/SecurityContext.php +++ b/Core/SecurityContext.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Security\Core; +trigger_error('The '.__NAMESPACE__.'\SecurityContext class is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface and Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface implementation to check for authentication and authorization.', E_USER_DEPRECATED); + use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; @@ -74,6 +76,8 @@ class SecurityContext implements SecurityContextInterface */ public function getToken() { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage::getToken() method instead.', E_USER_DEPRECATED); + return $this->tokenStorage->getToken(); } @@ -82,6 +86,8 @@ class SecurityContext implements SecurityContextInterface */ public function setToken(TokenInterface $token = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage::setToken() method instead.', E_USER_DEPRECATED); + return $this->tokenStorage->setToken($token); } @@ -90,6 +96,8 @@ class SecurityContext implements SecurityContextInterface */ public function isGranted($attributes, $object = null) { + trigger_error('The '.__METHOD__.' method is deprecated since version 2.6 and will be removed in 3.0. Use the Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface::isGranted() method instead.', E_USER_DEPRECATED); + return $this->authorizationChecker->isGranted($attributes, $object); } } diff --git a/Core/SecurityContextInterface.php b/Core/SecurityContextInterface.php index 0ad7bd3..0a77f00 100644 --- a/Core/SecurityContextInterface.php +++ b/Core/SecurityContextInterface.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Security\Core; +trigger_error('The '.__NAMESPACE__.'\SecurityContextInterface interface is deprecated since version 2.6 and will be removed in 3.0. Use both Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface and Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface interfaces instead.', E_USER_DEPRECATED); + use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; diff --git a/Tests/Core/LegacySecurityContextInterfaceTest.php b/Tests/Core/LegacySecurityContextInterfaceTest.php index 764a43d..3ff91d5 100644 --- a/Tests/Core/LegacySecurityContextInterfaceTest.php +++ b/Tests/Core/LegacySecurityContextInterfaceTest.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Security\Tests\Core; +trigger_error('The '.__NAMESPACE__.'\SecurityContextInterfaceTest class is deprecated since version 2.6 and will be removed in 3.0.', E_USER_DEPRECATED); + use Symfony\Component\Security\Core\SecurityContextInterface; use Symfony\Component\Security\Core\Security; |