Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #46956 [FrameworkBundle] Allow to specify
null
for exception ma…
…pping configuration values (andrew-demb) This PR was squashed before being merged into the 5.4 branch. Discussion ---------- [FrameworkBundle] Allow to specify `null` for exception mapping configuration values | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | | License | MIT | Doc PR | <!-- Replace this notice by a short README for your feature/bugfix. This will help reviewers and should be a good start for the documentation. Additionally (see https://symfony.com/releases): - Always add tests and ensure they pass. - Bug fixes must be submitted against the lowest maintained branch where they apply (lowest branches are regularly merged to upper ones so they get the fixes too.) - Features and deprecations must be submitted against the latest branch. - Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry - Never break backward compatibility (see https://symfony.com/bc). --> `null` should be allowed because it is stated as allowed in the configuration info [1][2] Marked as bugfix due to an existing mismatch between config description and behavior. [1] https://github.com/symfony/symfony/blob/a2f27add28f7c2c61ef4cfb4e97833509ced0fc0/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php#L1219-L1220 [2] https://github.com/symfony/symfony/blob/a2f27add28f7c2c61ef4cfb4e97833509ced0fc0/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php#L1227-L1228 Commits ------- 1de8f3a9ff [FrameworkBundle] Allow to specify `null` for exception mapping configuration values
- Loading branch information
Showing
5 changed files
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,27 @@ | ||
<?php | ||
|
||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; | ||
use Symfony\Component\HttpKernel\Exception\ConflictHttpException; | ||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; | ||
use Symfony\Component\HttpKernel\Exception\ServiceUnavailableHttpException; | ||
|
||
$container->loadFromExtension('framework', [ | ||
'exceptions' => [ | ||
BadRequestHttpException::class => [ | ||
'log_level' => 'info', | ||
'status_code' => 422, | ||
], | ||
NotFoundHttpException::class => [ | ||
'log_level' => 'info', | ||
'status_code' => null, | ||
], | ||
ConflictHttpException::class => [ | ||
'log_level' => 'info', | ||
'status_code' => 0, | ||
], | ||
ServiceUnavailableHttpException::class => [ | ||
'log_level' => null, | ||
'status_code' => 500, | ||
], | ||
], | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters