8000 fix: clarify parameter name to comply with deprecations from #34074 · Nijusan/symfony@7045fe9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7045fe9

Browse files
author
Dennis Langen
committed
fix: clarify parameter name to comply with deprecations from symfony#34074
1 parent c23166c commit 7045fe9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ public function setContainer(ContainerInterface $container): ?ContainerInterface
6767
{
6868
$previous = $this->container;
6969
$this->container = $container;
70+
$this->container = $container;
7071

7172
return $previous;
7273
}
@@ -207,30 +208,30 @@ protected function addFlash(string $type, $message): void
207208
}
208209

209210
/**
210-
* Checks if the attributes are granted against the current authentication token and optionally supplied subject.
211+
* Checks if the attribute is granted against the current authentication token and optionally supplied subject.
211212
*
212213
* @throws \LogicException
213214
*/
214-
protected function isGranted($attributes, $subject = null): bool
215+
protected function isGranted($attribute, $subject = null): bool
215216
{
216217
if (!$this->container->has('security.authorization_checker')) {
217218
throw new \LogicException('The SecurityBundle is not registered in your application. Try running "composer require symfony/security-bundle".');
218219
}
219220

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

223224
/**
224-
* Throws an exception unless the attributes are granted against the current authentication token and optionally
225+
* Throws an exception unless the attribute is granted against the current authentication token and optionally
225226
* supplied subject.
226227
*
227228
* @throws AccessDeniedException
228229
*/
229-
protected function denyAccessUnlessGranted($attributes, $subject = null, string $message = 'Access Denied.'): void
230+
protected function denyAccessUnlessGranted($attribute, $subject = null, string $message = 'Access Denied.'): void
230231
{
231-
if (!$this->isGranted($attributes, $subject)) {
232+
if (!$this->isGranted($attribute, $subject)) {
232233
$exception = $this->createAccessDeniedException($message);
233-
$exception->setAttributes($attributes);
234+
$exception->setAttributes($attribute);
234235
$exception->setSubject($subject);
235236

236237
throw $exception;

0 commit comments

Comments
 (0)
0