Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commita94e29f

Browse files
committed
feature#22821 [Security] remove deprecated features (xabbuh)
This PR was merged into the 4.0-dev branch.Discussion----------[Security] remove deprecated features| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | no| BC breaks? | yes| Deprecations? | no| Tests pass? | yes| Fixed tickets || License | MIT| Doc PR |Commits-------2397504 [Security] remove deprecated features
2 parents250481d +2397504 commita94e29f

File tree

15 files changed

+32
-221
lines changed

15 files changed

+32
-221
lines changed

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

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
useSymfony\Component\HttpFoundation\Response;
1919
useSymfony\Component\HttpKernel\DataCollector\DataCollector;
2020
useSymfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
21-
useSymfony\Component\Security\Core\Role\RoleInterface;
2221
useSymfony\Component\Security\Http\Logout\LogoutUrlGenerator;
2322
useSymfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
2423
useSymfony\Component\Security\Core\Authorization\TraceableAccessDecisionManager;
@@ -111,23 +110,15 @@ public function collect(Request $request, Response $response, \Exception $except
111110
// fail silently when the logout URL cannot be generated
112111
}
113112

114-
$extractRoles =function ($role) {
115-
if (!$roleinstanceof RoleInterface && !$roleinstanceof Role) {
116-
thrownew \InvalidArgumentException(sprintf('Roles must be instances of %s or %s (%s given).', RoleInterface::class, Role::class,is_object($role) ?get_class($role) :gettype($role)));
117-
}
118-
119-
return$role->getRole();
120-
};
121-
122113
$this->data =array(
123114
'enabled' =>true,
124115
'authenticated' =>$token->isAuthenticated(),
125116
'token' =>$token,
126117
'token_class' =>$this->hasVarDumper ?newClassStub(get_class($token)) :get_class($token),
127118
'logout_url' =>$logoutUrl,
128119
'user' =>$token->getUsername(),
129-
'roles' =>array_map($extractRoles,$assignedRoles),
130-
'inherited_roles' =>array_map($extractRoles,$inheritedRoles),
120+
'roles' =>array_map(function (Role$role) {return$role->getRole(); },$assignedRoles),
121+
'inherited_roles' =>array_map(function (Role$role) {return$role->getRole(); },$inheritedRoles),
131122
'supports_role_hierarchy' =>null !==$this->roleHierarchy,
132123
);
133124
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ CHANGELOG
44
4.0.0
55
-----
66

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`
711
* added a sixth`string $context` argument to`LogoutUrlGenerator::registerListener()`
812

913
3.3.0

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespaceSymfony\Component\Security\Core\Authentication\Token;
1313

14-
useSymfony\Component\Security\Core\Role\RoleInterface;
1514
useSymfony\Component\Security\Core\Role\Role;
1615
useSymfony\Component\Security\Core\User\UserInterface;
1716
useSymfony\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 ($rolesas$role) {
4342
if (is_string($role)) {
4443
$role =newRole($role);
45-
}elseif (!$roleinstanceofRoleInterface) {
46-
thrownew \InvalidArgumentException(sprintf('$roles must be an array of strings, orRoleInterface instances, but got %s.',gettype($role)));
44+
}elseif (!$roleinstanceofRole) {
45+
thrownew \InvalidArgumentException(sprintf('$roles must be an array of strings, orRole instances, but got %s.',gettype($role)));
4746
}
4847

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

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

Lines 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
publicfunction__construct($user,$credentials,$providerKey,array$roles =array())
3333
{

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespaceSymfony\Component\Security\Core\Authentication\Token;
1313

14-
useSymfony\Component\Security\Core\Role\RoleInterface;
14+
useSymfony\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-
* @returnRoleInterface[] An array ofRoleInterface instances
36+
* @returnRole[] An array ofRole instances
3737
*/
3838
publicfunctiongetRoles();
3939

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

Lines 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‎

Lines 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-
publicfunctionsetVoters(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‎

Lines changed: 0 additions & 36 deletions
This file was deleted.

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

Lines 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-
publicfunctionsetVoters(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‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespaceSymfony\Component\Security\Core\Authorization\Voter;
1313

1414
useSymfony\Component\Security\Core\Authentication\Token\TokenInterface;
15-
useSymfony\Component\Security\Core\Role\RoleInterface;
15+
useSymfony\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 ($attributesas$attribute) {
45-
if ($attributeinstanceofRoleInterface) {
45+
if ($attributeinstanceofRole) {
4646
$attribute =$attribute->getRole();
4747
}
4848

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp