8000 bug #26998 Revert the type declaration of Role merged in #26821 (DQNEO) · symfony/symfony@773c9df · GitHub
[go: up one dir, main page]

Skip to content

Commit 773c9df

Browse files
committed
bug #26998 Revert the type declaration of Role merged in #26821 (DQNEO)
This PR was merged into the 4.1-dev branch. Discussion ---------- Revert the type declaration of Role merged in #26821 | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | in #2681 (https://github.com/symfony/symfony/pull/26821/files#diff-5febf3ee0bb2e743b1a929abe55968e8R89) I added a `Role` type declaration. But users who had played duck type there could face B.C. break. So I'd like to revert the change. Commits ------- 66adc9f Revert the type declaration for Role, because users might do duck typing.
2 parents 833909b + 66adc9f commit 773c9df

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Component/Security/Core/Authorization/Voter/ExpressionVoter.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1515
use Symfony\Component\Security\Core\Authentication\AuthenticationTrustResolverInterface;
1616
use Symfony\Component\Security\Core\Authorization\ExpressionLanguage;
17-
use Symfony\Component\Security\Core\Role\Role;
1817
use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
1918
use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface;
2019
use Symfony\Component\ExpressionLanguage\Expression;
@@ -86,7 +85,7 @@ private function getVariables(TokenInterface $token, $subject)
8685
'user' => $token->getUser(),
8786
'object' => $subject,
8887
'subject' => $subject,
89-
'roles' => array_map(function (Role $role) { return $role->getRole(); }, $roles),
88+
'roles' => array_map(function ($role) { return $role->getRole(); }, $roles),
9089
'trust_resolver' => $this->trustResolver,
9190
);
9291

0 commit comments

Comments
 (0)
0