Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 6a11506

Browse filesBrowse files
committed
[Security] remove deprecated features
1 parent b777f42 commit 6a11506
Copy full SHA for 6a11506

File tree

Expand file treeCollapse file tree

16 files changed

+40
-227
lines changed
Filter options
Expand file treeCollapse file tree

16 files changed

+40
-227
lines changed

‎src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
namespace Symfony\Bundle\SecurityBundle\DataCollector;
1313

1414
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
15+
use Symfony\Component\Security\Core\Role\Role;
1516
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
1617
use Symfony\Component\HttpFoundation\Request;
1718
use Symfony\Component\HttpFoundation\Response;
1819
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
1920
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
20-
use Symfony\Component\Security\Core\Role\RoleInterface;
2121
use Symfony\Component\Security\Http\Logout\LogoutUrlGenerator;
2222
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
2323
use Symfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager;
@@ -117,8 +117,8 @@ public function collect(Request $request, Response $response, \Exception $except
117117
'token_class' => $this->hasVarDumper ? new ClassStub(get_class($token)) : get_class($token),
118118
'logout_url' => $logoutUrl,
119119
'user' => $token->getUsername(),
120-
'roles' => array_map(function (RoleInterface $role) { return $role->getRole(); }, $assignedRoles),
121-
'inherited_roles' => array_map(function (RoleInterface $role) { return $role->getRole(); }, $inheritedRoles),
120+
'roles' => array_map(function (Role $role) { return $role->getRole(); }, $assignedRoles),
121+
'inherited_roles' => array_map(function (Role $role) { return $role->getRole(); }, $inheritedRoles),
122122
'supports_role_hierarchy' => null !== $this->roleHierarchy,
123123
);
124124
}

‎src/Symfony/Component/Security/CHANGELOG.md

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/CHANGELOG.md
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
CHANGELOG
22
=========
33

4+
4.0.0
5+
-----
6+
7+
* The `AbstractFormLoginAuthenticator::onAuthenticationSuccess()` was removed.
8+
You should implement this method yourself in your concrete authenticator.
9+
* removed the `AccessDecisionManager::setVoters()` method
10+
* removed the `RoleInterface`
11+
* added a sixth `$context` argument to the `LogoutUrlGenerator::registerListener()`
12+
method
13+
414
3.3.0
515
-----
616

‎src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14-
use Symfony\Component\Security\Core\Role\RoleInterface;
1514
use Symfony\Component\Security\Core\Role\Role;
1615
use Symfony\Component\Security\Core\User\UserInterface;
1716
use Symfony\Component\Security\Core\User\AdvancedUserInterface;
@@ -33,7 +32,7 @@ abstract class AbstractToken implements TokenInterface
3332
/**
3433
* Constructor.
3534
*
36-
* @param (RoleInterface|string)[] $roles An array of roles
35+
* @param (Role|string)[] $roles An array of roles
3736
*
3837
* @throws \InvalidArgumentException
3938
*/
@@ -42,8 +41,8 @@ public function __construct(array $roles = array())
4241
foreach ($roles as $role) {
4342
if (is_string($role)) {
4443
$role = new Role($role);
45-
} elseif (!$role instanceof RoleInterface) {
46-
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, or RoleInterface instances, but got %s.', gettype($role)));
44+
} elseif (!$role instanceof Role) {
45+
throw new \InvalidArgumentException(sprintf('$roles must be an array of strings, or Role instances, but got %s.', gettype($role)));
4746
}
4847

4948
$this->roles[] = $role;

‎src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/PreAuthenticatedToken.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class PreAuthenticatedToken extends AbstractToken
2424
/**
2525
* Constructor.
2626
*
27-
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
28-
* @param mixed $credentials The user credentials
29-
* @param string $providerKey The provider key
30-
* @param (RoleInterface|string)[] $roles An array of roles
27+
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
28+
* @param mixed $credentials The user credentials
29+
* @param string $providerKey The provider key
30+
* @param (Role|string)[] $roles An array of roles
3131
*/
3232
public function __construct($user, $credentials, $providerKey, array $roles = array())
3333
{

‎src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/TokenInterface.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\Security\Core\Authentication\Token;
1313

14-
use Symfony\Component\Security\Core\Role\RoleInterface;
14+
use Symfony\Component\Security\Core\Role\Role;
1515

1616
/**
1717
* TokenInterface is the interface for the user authentication information.
@@ -33,7 +33,7 @@ public function __toString();
3333
/**
3434
* Returns the user roles.
3535
*
36-
* @return RoleInterface[] An array of RoleInterface instances
36+
* @return Role[] An array of Role instances
3737
*/
3838
public function getRoles();
3939

‎src/Symfony/Component/Security/Core/Authentication/Token/UsernamePasswordToken.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authentication/Token/UsernamePasswordToken.php
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ class UsernamePasswordToken extends AbstractToken
2424
/**
2525
* Constructor.
2626
*
27-
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
28-
* @param string $credentials This usually is the password of the user
29-
* @param string $providerKey The provider key
30-
* @param (RoleInterface|string)[] $roles An array of roles
27+
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
28+
* @param string $credentials This usually is the password of the user
29+
* @param string $providerKey The provider key
30+
* @param (Role|string)[] $roles An array of roles
3131
*
3232
* @throws \InvalidArgumentException
3333
*/

‎src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php
-14Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,6 @@ public function __construct($voters = array(), $strategy = self::STRATEGY_AFFIRM
5252
$this->allowIfEqualGrantedDeniedDecisions = (bool) $allowIfEqualGrantedDeniedDecisions;
5353
}
5454

55-
/**
56-
* Configures the voters.
57-
*
58-
* @param VoterInterface[] $voters An array of VoterInterface instances
59-
*
60-
* @deprecated since version 3.3, to be removed in 4.0. Pass the voters to the constructor instead.
61-
*/
62-
public function setVoters(array $voters)
63-
{
64-
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Pass the voters to the constructor instead.', __METHOD__), E_USER_DEPRECATED);
65-
66-
$this->voters = $voters;
67-
}
68-
6955
/**
7056
* {@inheritdoc}
7157
*/

‎src/Symfony/Component/Security/Core/Authorization/DebugAccessDecisionManager.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/DebugAccessDecisionManager.php
-36Lines changed: 0 additions & 36 deletions
This file was deleted.

‎src/Symfony/Component/Security/Core/Authorization/TraceableAccessDecisionManager.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/TraceableAccessDecisionManager.php
-17Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,6 @@ public function decide(TokenInterface $token, array $attributes, $object = null)
6060
return $result;
6161
}
6262

63-
/**
64-
* {@inheritdoc}
65-
*
66-
* @deprecated since version 3.3, to be removed in 4.0. Pass voters to the decorated AccessDecisionManager instead.
67-
*/
68-
public function setVoters(array $voters)
69-
{
70-
@trigger_error(sprintf('The %s() method is deprecated since version 3.3 and will be removed in 4.0. Pass voters to the decorated AccessDecisionManager instead.', __METHOD__), E_USER_DEPRECATED);
71-
72-
if (!method_exists($this->manager, 'setVoters')) {
73-
return;
74-
}
75-
76-
$this->voters = $voters;
77-
$this->manager->setVoters($voters);
78-
}
79-
8063
/**
8164
* @return string
8265
*/

‎src/Symfony/Component/Security/Core/Authorization/Voter/RoleVoter.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Voter/RoleVoter.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Security\Core\Authorization\Voter;
1313

1414
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
15-
use Symfony\Component\Security\Core\Role\RoleInterface;
15+
use Symfony\Component\Security\Core\Role\Role;
1616

1717
/**
1818
* RoleVoter votes if any attribute starts with a given prefix.
@@ -42,7 +42,7 @@ public function vote(TokenInterface $token, $subject, array $attributes)
4242
$roles = $this->extractRoles($token);
4343

4444
foreach ($attributes as $attribute) {
45-
if ($attribute instanceof RoleInterface) {
45+
if ($attribute instanceof Role) {
4646
$attribute = $attribute->getRole();
4747
}
4848

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.