10000 fix: clarify parameter name to comply with deprecations from #34074 · symfony/symfony@91249ed · GitHub
[go: up one dir, main page]

Skip to content

Commit 91249ed

Browse files
Dennis Langenfabpot
Dennis Langen
authored andcommitted
fix: clarify parameter name to comply with deprecations from #34074
1 parent 56bf1bc commit 91249ed

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/Symfony/Bundle/FrameworkBundle/Controller/AbstractController.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -207,30 +207,30 @@ protected function addFlash(string $type, $message): void
207207
}
208208

209209
/**
210-
* Checks if the attributes are granted against the current authentication token and optionally supplied subject.
210+
* Checks if the attribute is granted against the current authentication token and optionally supplied subject.
211211
*
212212
* @throws \LogicException
213213
*/
214-
protected function isGranted($attributes, $subject = null): bool
214+
protected function isGranted($attribute, $subject = null): bool
215215
{
216216
if (!$this->container->has('security.authorization_checker')) {
217217
throw new \LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".');
218218
}
219219

220-
return $this->container->get('security.authorization_checker')->isGranted($attributes, $subject);
220+
return $this->container->get('security.authorization_checker')->isGranted($attribute, $subject);
221221
}
222222

223223
/**
224-
* Throws an exception unless the attributes are granted against the current authentication token and optionally
224+
* Throws an exception unless the attribute is granted against the current authentication token and optionally
225225
* supplied subject.
226226
*
227227
* @throws AccessDeniedException
228228
*/
229-
protected function denyAccessUnlessGranted($attributes, $subject = null, string $message = 'Access Denied.'): void
229+
protected function denyAccessUnlessGranted($attribute, $subject = null, string $message = 'Access Denied.'): void
230230
{
231-
if (!$this->isGranted($attributes, $subject)) {
231+
if (!$this->isGranted($attribute, $subject)) {
232232
$exception = $this->createAccessDeniedException($message);
233-
$exception->setAttributes($attributes);
233+
$exception->setAttributes($attribute);
234234
$exception->setSubject($subject);
235235

236236
throw $exception;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
interface AuthorizationCheckerInterface
2020
{
2121
/**
22-
* Checks if the attributes are granted against the current authentication token and optionally supplied subject.
22+
* Checks if the attribute is granted against the current authentication token and optionally supplied subject.
2323
*
2424
* @param mixed $attribute A single attribute to vote on (can be of any type, string and instance of Expression are supported by the core)
2525
* @param mixed $subject

0 commit comments

Comments
 (0)
0