8000 Clarified single attribute to isGranted() a bit more · symfony/symfony@3e7a36f · GitHub
[go: up one dir, main page]

Skip to content

Commit 3e7a36f

Browse files
committed
Clarified single attribute to isGranted() a bit more
1 parent 7677694 commit 3e7a36f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(TokenStorageInterface $tokenStorage, AuthenticationM
4444
*
4545
* @throws AuthenticationCredentialsNotFoundException when the token storage has no authentication token
4646
*/
47-
final public function isGranted($attributes, $subject = null): bool
47+
final public function isGranted($attribute, $subject = null): bool
4848
{
4949
if (null === ($token = $this->tokenStorage->getToken())) {
5050
throw new AuthenticationCredentialsNotFoundException('The token storage contains no authentication token. One possible reason may be that there is no firewall configured for this URL.');
@@ -54,10 +54,10 @@ final public function isGranted($attributes, $subject = null): bool
5454
$this->tokenStorage->setToken($token = $this->authenticationManager->authenticate($token));
5555
}
5656

57-
if (\is_array($attributes)) {
57+
if (\is_array($attribute)) {
5858
throw new InvalidArgumentException(sprintf('Passing an array of Security attributes to %s() is not supported.', __METHOD__));
5959
}
6060

61-
return $this->accessDecisionManager->decide($token, [$attributes], $subject);
61+
return $this->accessDecisionManager->decide($token, [$attribute], $subject);
6262
}
6363
}

src/Symfony/Component/Security/Core/Authorization/AuthorizationCheckerInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ interface AuthorizationCheckerInterface
2121
/**
2222
* Checks if the attributes are granted against the current authentication token and optionally supplied subject.
2323
*
24-
* @param mixed $attributes
25-
* @param mixed $subject
24+
* @param string $attribute
25+
* @param mixed $subject
2626
*
2727
* @return bool
2828
*/
29-
public function isGranted($attributes, $subject = null);
29+
public function isGranted($attribute, $subject = null);
3030
}

0 commit comments

Comments
 (0)
0