Skip to content

Commit 14b8c51

Browse files
Merge branch '4.0'
* 4.0: (23 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 [Console] Simplify parameters in DI 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 ...
2 parents df4781a + c142e38 commit 14b8c51

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
@@ -75,10 +75,10 @@ CHANGELOG
7575
`Symfony\Component\EventDispatcher\EventDispatcherInterface` as
7676
first argument
7777
* `RouterDebugCommand::__construct()` now takes an instance of
78-
`Symfony\Component\Routing\RouterInteface` as
78+
`Symfony\Component\Routing\RouterInterface` as
7979
first argument
8080
* `RouterMatchCommand::__construct()` now takes an instance of
81-
`Symfony\Component\Routing\RouterInteface` as
81+
`Symfony\Component\Routing\RouterInterface` as
8282
first argument
8383
* `TranslationDebugCommand::__construct()` now takes an instance of
8484
`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)