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 f2a827b

Browse filesBrowse files
committed
Rebase for 6.3
1 parent b53c509 commit f2a827b
Copy full SHA for f2a827b
Expand file treeCollapse file tree

35 files changed

+138
-99
lines changed

‎UPGRADE-6.3.md

Copy file name to clipboardExpand all lines: UPGRADE-6.3.md
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ Validator
9393

9494
* Implementing the `ConstraintViolationInterface` without implementing the `getConstraint()` method is deprecated
9595

96+
Security
97+
--------
98+
99+
* Add method `getDecision()` to `AccessDecisionStrategyInterface`
100+
* Deprecate `AccessDecisionStrategyInterface::decide()` in favor of `AccessDecisionStrategyInterface::getDecision()`
101+
* Add method `getVote()` to `VoterInterface`
102+
* Deprecate `VoterInterface::vote()` in favor of `AccessDecisionStrategyInterface::getVote()`
103+
* Deprecate returning `bool` from `Voter::voteOnAttribute()` (it must return a `Vote`)
104+
* Add method `getDecision()` to `AccessDecisionManagerInterface`
105+
* Deprecate `AccessDecisionManagerInterface::decide()` in favor of `AccessDecisionManagerInterface::getDecision()`
106+
* Add method `getDecision()` to `AuthorizationCheckerInterface`
107+
96108
Serializer
97109
----------
98110

‎src/Symfony/Bundle/SecurityBundle/Tests/EventListener/VoteListenerTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Bundle/SecurityBundle/Tests/EventListener/VoteListenerTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function testOnVoterVoteLegacy()
5050
$traceableAccessDecisionManager = $this
5151
->getMockBuilder(TraceableAccessDecisionManager::class)
5252
->disableOriginalConstructor()
53-
->setMethods(['addVoterVote'])
53+
->onlyMethods(['addVoterVote'])
5454
->getMock();
5555

5656
$traceableAccessDecisionManager

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/CHANGELOG.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The CHANGELOG for version 5.4 and newer can be found in the security sub-package
2828
* Deprecate `UserProviderInterface::loadUserByUsername()` in favor of `UserProviderInterface::loadUserByIdentifier()`
2929
* Deprecate `TokenInterface::getUsername()` in favor of `TokenInterface::getUserIdentifier()`
3030
* Deprecate `UserInterface::getUsername()` in favor of `getUserIdentifier()`
31-
* Add `PassportInterface:getBadges()`, implemented by `PassportTrait`
31+
* Add `PassportInterface:getBadges()`, implemented &by `PassportTrait`
3232
* [BC BREAK] Remove method `checkIfCompletelyResolved()` from `PassportInterface`, checking that passport badges are
3333
resolved is up to `AuthenticatorManager`
3434
* Deprecate class `User`, use `InMemoryUser` instead

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/AccessDecision.php
+2-12Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,12 @@
2222
*/
2323
final class AccessDecision
2424
{
25-
/** @var int One of the VoterInterface::ACCESS_* constants */
26-
private int $access;
27-
28-
/** @var Vote[] */
29-
private array $votes = [];
30-
3125
/**
3226
* @param int $access One of the VoterInterface::ACCESS_* constants
3327
* @param Vote[] $votes
3428
*/
35-
private function __construct(int $access, array $votes = [])
29+
private function __construct(private readonly int $access, private readonly array $votes = [])
3630
{
37-
$this->access = $access;
38-
$this->votes = $votes;
3931
}
4032

4133
public function getAccess(): int
@@ -111,8 +103,6 @@ public function getDeniedVotes(): array
111103
*/
112104
private function getVotesByAccess(int $access): array
113105
{
114-
return array_filter($this->votes, static function (Vote $vote) use ($access): bool {
115-
return $vote->getAccess() === $access;
116-
});
106+
return array_filter($this->votes, static fn (Vote $vote): bool => $vote->getAccess() === $access);
117107
}
118108
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php
+2-8Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,6 @@
2727
*/
2828
final class AccessDecisionManager implements AccessDecisionManagerInterface
2929
{
30-
private const VALID_VOTES = [
31-
VoterInterface::ACCESS_GRANTED => true,
32-
VoterInterface::ACCESS_DENIED => true,
33-
VoterInterface::ACCESS_ABSTAIN => true,
34-
];
35-
3630
private iterable $voters;
3731
private array $votersCacheAttributes = [];
3832
private array $votersCacheObject = [];
@@ -70,11 +64,11 @@ public function getDecision(TokenInterface $token, array $attributes, mixed $obj
7064
/**
7165
* @param bool $allowMultipleAttributes Whether to allow passing multiple values to the $attributes array
7266
*
73-
* @deprecated since Symfony 6.2, use {@see getDecision()} instead.
67+
* @deprecated since Symfony 6.3, use {@see getDecision()} instead.
7468
*/
7569
public function decide(TokenInterface $token, array $attributes, mixed $object = null, bool $allowMultipleAttributes = false): bool
7670
{
77-
trigger_deprecation('symfony/security-core', '6.2', 'Method "%s::decide()" has been deprecated, use "%s::getDecision()" instead.', __CLASS__, __CLASS__);
71+
trigger_deprecation('symfony/security-core', '6.3', 'Method "%s::decide()" has been deprecated, use "%s::getDecision()" instead.', __CLASS__, __CLASS__);
7872

7973
// Special case for AccessListener, do not remove the right side of the condition before 6.0
8074
if (\count($attributes) > 1 && !$allowMultipleAttributes) {

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/AccessDecisionManagerInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface AccessDecisionManagerInterface
2828
* @param array $attributes An array of attributes associated with the method being invoked
2929
* @param mixed $object The object to secure
3030
*
31-
* @deprecated since Symfony 6.2, use {@see getDecision()} instead.
31+
* @deprecated since Symfony 6.3, use {@see getDecision()} instead.
3232
*/
3333
public function decide(TokenInterface $token, array $attributes, mixed $object = null): bool;
3434
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/AuthorizationChecker.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ final public function getDecision($attribute, $subject = null): AccessDecision
5151
}
5252

5353
if (!method_exists($this->accessDecisionManager, 'getDecision')) {
54-
trigger_deprecation('symfony/security-core', '6.2', 'Not implementing "%s::getDecision()" method is deprecated, and would be required in 7.0.', \get_class($this->accessDecisionManager));
54+
trigger_deprecation('symfony/security-core', '6.3', 'Not implementing "%s::getDecision()" method is deprecated, and would be required in 7.0.', \get_class($this->accessDecisionManager));
5555

5656
return $this->accessDecisionManager->decide($token, [$attribute], $subject) ? AccessDecision::createGranted() : AccessDecision::createDenied();
5757
}

‎src/Symfony/Component/Security/Core/Authorization/Strategy/AccessDecisionStrategyInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Strategy/AccessDecisionStrategyInterface.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface AccessDecisionStrategyInterface
2525
/**
2626
* @param \Traversable<int> $results
2727
*
28-
* @deprecated since Symfony 6.2, use {@see getDecision()} instead.
28+
* @deprecated since Symfony 6.3, use {@see getDecision()} instead.
2929
*/
3030
public function decide(\Traversable $results): bool;
3131
}

‎src/Symfony/Component/Security/Core/Authorization/Strategy/AffirmativeStrategy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Strategy/AffirmativeStrategy.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getDecision(\Traversable $votes): AccessDecision
6363

6464
public function decide(\Traversable $results): bool
6565
{
66-
trigger_deprecation('symfony/security-core', '6.2', 'Method "%s::decide()" has been deprecated, use "%s::getDecision()" instead.', __CLASS__, __CLASS__);
66+
trigger_deprecation('symfony/security-core', '6.3', 'Method "%s::decide()" has been deprecated, use "%s::getDecision()" instead.', __CLASS__, __CLASS__);
6767

6868
$deny = 0;
6969
foreach ($results as $result) {

‎src/Symfony/Component/Security/Core/Authorization/Strategy/ConsensusStrategy.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Authorization/Strategy/ConsensusStrategy.php
+1-7Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ public function __construct(bool $allowIfAllAbstainDecisions = false, bool $allo
4444
$this->allowIfEqualGrantedDeniedDecisions = $allowIfEqualGrantedDeniedDecisions;
4545
}
4646

47-
/**
48-
* {@inheritdoc}
49-
*/
5047
public function getDecision(\Traversable $votes): AccessDecision
5148
{
5249
$currentVotes = [];
@@ -84,12 +81,9 @@ public function getDecision(\Traversable $votes): AccessDecision
8481
;
8582
}
8683

87-
/**
88-
* {@inheritdoc}
89-
*/
9084
public function decide(\Traversable $results): bool
9185
{
92-
trigger_deprecation('symfony/security-core', '6.2', 'Method "%s::decide()" has been deprecated, use "%s::getDecision()" instead.', __CLASS__, __CLASS__);
86+
trigger_deprecation('symfony/security-core', '6.3', 'Method "%s::decide()" has been deprecated, use "%s::getDecision()" instead.', __CLASS__, __CLASS__);
9387

9488
$grant = 0;
9589
$deny = 0;

0 commit comments

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