Skip to content

Commit c142e38

Browse files
Merge branch '3.4' into 4.0
* 3.4: (22 commits) Add application/ld+json format associated to json [HttpFoundation] Fix false-positive ConflictingHeadersException remove flex-specific suggestion on 3.4 Add check for SecurityBundle in createAccessDeniedException [WebServerBundle] Fix escaping of php binary with arguments Error handlers' $context should be optional as it's deprecated [Serializer] Correct typing mistake in DocBlock [HttpKernel] fix cleaning legacy containers Display n/a for sub-requests time when Stopwatch component is not installed Updating message to inform the user how to install the component [Config] Fix closure CS PHP CS Fixer: use PHPUnit Migration ruleset [Process] Skip false-positive test on Windows/appveyor Update MemcachedTrait.php [Bridge/PhpUnit] thank phpunit/phpunit allow auto_wire for SessionAuthenticationStrategy class [Process] Fix setting empty env vars Fixed 'RouterInteface' typo [Process] Dont use getenv(), it returns arrays and can introduce subtle breaks accros PHP versions [WebServerBundle] fix a bug where require would not require the good file because of env ...
2 parents c6a68cf + ca78656 commit c142e38

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ CHANGELOG
6767
`Symfony\Component\EventDispatcher\EventDispatcherInterface` as
6868
first argument
6969
* `RouterDebugCommand::__construct()` now takes an instance of
70-
`Symfony\Component\Routing\RouterInteface` as
70+
`Symfony\Component\Routing\RouterInterface` as
7171
first argument
7272
* `RouterMatchCommand::__construct()` now takes an instance of
73-
`Symfony\Component\Routing\RouterInteface` as
73+
`Symfony\Component\Routing\RouterInterface` as
7474
first argument
7575
* `TranslationDebugCommand::__construct()` now takes an instance of
7676
`Symfony\Component\Translation\TranslatorInterface` as

Controller/ControllerTrait.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,16 @@ protected function createNotFoundException(string $message = 'Not Found', \Excep
289289
*
290290
* throw $this->createAccessDeniedException('Unable to access this page!');
291291
*
292+
* @throws \LogicException If the Security component is not available
293+
*
292294
* @final since version 3.4
293295
*/
294296
protected function createAccessDeniedException(string $message = 'Access Denied.', \Exception $previous = null): AccessDeniedException
295297
{
298+
if (!class_exists(AccessDeniedException::class)) {
299+
throw new \LogicException('You can not use the "createAccessDeniedException" method if the Security component is not available.');
300+
}
301+
296302
return new AccessDeniedException($message, $previous);
297303
}
298304

0 commit comments

Comments
 (0)