Skip to content
This repository was archived by the owner on May 31, 2024. It is now read-only.

Commit 52f9447

Browse files
committed
minor #13060 [2.7] adds deprecation notices. (hhamon)
This PR was merged into the 2.7 branch. Discussion ---------- [2.7] adds deprecation notices. | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | yes | Tests pass? | yes | Fixed tickets | #12608, #12672, #12675 #12684, #12686 | License | MIT | Doc PR | ~ Commits ------- f9fbb4f Fixes more deprecation notices as per @stof review. fd47c07 Fixed some deprecations according to @stof feedbacks. 2a3e7d2 Normalizes deprecation notice messages. 738b9be [Validator] fixes UuidValidator deprecated class namespace. e608ba6 [Form] adds more deprecation notices. cd9617a [Validator] adds more deprecation notices. a7f841e [Form] Adds a way to trigger deprecation notice on demand for VirtualFormAwareIterator class. 97efd2c Fixes more deprecation notices. fd9c7bb Normalized @deprecated annotations. 39cfd47 Removed deprecation notices from test files. 2a9749d Fixes deprecation notices. 6f57b7b Reverted trigger_error() function calls on deprecated interfaces to prevent breaking third party projects implementing them. 86b9f6b Adds deprecation notices for structures to be removed in 3.0.
2 parents d965ec7 + 033a767 commit 52f9447

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Core/SecurityContext.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @author Fabien Potencier <[email protected]>
2828
* @author Johannes M. Schmitt <[email protected]>
29-
* @deprecated Deprecated since version 2.6, to be removed in 3.0.
29+
* @deprecated since version 2.6, to be removed in 3.0.
3030
*/
3131
class SecurityContext implements SecurityContextInterface
3232
{
@@ -70,26 +70,38 @@ public function __construct($tokenStorage, $authorizationChecker, $alwaysAuthent
7070
}
7171

7272
/**
73+
* @deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::getToken() instead.
74+
*
7375
* {@inheritdoc}
7476
*/
7577
public function getToken()
7678
{
79+
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);
80+
7781
return $this->tokenStorage->getToken();
7882
}
7983

8084
/**
85+
* @deprecated since version 2.6, to be removed in 3.0. Use TokenStorageInterface::setToken() instead.
86+
*
8187
* {@inheritdoc}
8288
*/
8389
public function setToken(TokenInterface $token = null)
8490
{
91+
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);
92+
8593
return $this->tokenStorage->setToken($token);
8694
}
8795

8896
/**
97+
* @deprecated since version 2.6, to be removed in 3.0. Use AuthorizationCheckerInterface::isGranted() instead.
98+
*
8999
* {@inheritdoc}
90100
*/
91101
public function isGranted($attributes, $object = null)
92102
{
103+
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);
104+
93105
return $this->authorizationChecker->isGranted($attributes, $object);
94106
}
95107
}

0 commit comments

Comments
 (0)