Skip to content

Commit 44a0f70

Browse files
committed
bug #46956 [FrameworkBundle] Allow to specify null for exception mapping 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
2 parents 44218ca + bc58e54 commit 44a0f70

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

EventListener/ErrorListener.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,14 @@ class ErrorListener implements EventSubscriberInterface
3333
protected $controller;
3434
protected $logger;
3535
protected $debug;
36+
/**
37+
* @var array<class-string, array{log_level: string|null, status_code: int<100,599>|null}>
38+
*/
3639
protected $exceptionsMapping;
3740

41+
/**
42+
* @param array<class-string, array{log_level: string|null, status_code: int<100,599>|null}> $exceptionsMapping
43+
*/
3844
public function __construct($controller, LoggerInterface $logger = null, bool $debug = false, array $exceptionsMapping = [])
3945
{
4046
$this->controller = $controller;

0 commit comments

Comments
 (0)