|
17 | 17 | use Symfony\Component\DependencyInjection\Exception\LogicException;
|
18 | 18 | use Symfony\Component\DependencyInjection\Loader;
|
19 | 19 | use Symfony\Component\DependencyInjection\Reference;
|
| 20 | +use Symfony\Component\ErrorHandler\Error\FatalError; |
20 | 21 | use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
21 | 22 | use Symfony\Component\HttpKernel\Event\ExceptionEvent;
|
22 | 23 | use Symfony\Component\HttpKernel\KernelEvents;
|
@@ -128,18 +129,15 @@ private function passConfigurationToOptions(ContainerBuilder $container, array $
|
128 | 129 | }
|
129 | 130 | }
|
130 | 131 |
|
131 |
| - if (\array_key_exists('excluded_exceptions', $processedOptions) && $processedOptions['excluded_exceptions']) { |
132 |
| - $ignoreOptions = [ |
133 |
| - 'ignore_exceptions' => $processedOptions['excluded_exceptions'], |
134 |
| - ]; |
135 |
| - |
136 |
| - $integrations[] = new Definition(IgnoreErrorsIntegration::class, [$ignoreOptions]); |
137 |
| - } |
| 132 | + // we ignore fatal errors wrapped by Symfony because they produce double event reporting |
| 133 | + $processedOptions['excluded_exceptions'][] = FatalError::class; |
| 134 | + $ignoreOptions = [ |
| 135 | + 'ignore_exceptions' => $processedOptions['excluded_exceptions'], |
| 136 | + ]; |
138 | 137 |
|
139 |
| - $integrationsCallable = new Definition('callable', [$integrations]); |
140 |
| - $integrationsCallable->setFactory([IntegrationFilterFactory::class, 'create']); |
| 138 | + $integrations[] = new Definition(IgnoreErrorsIntegration::class, [$ignoreOptions]); |
141 | 139 |
|
142 |
| - $options->addMethodCall('setIntegrations', [$integrationsCallable]); |
| 140 | + $options->addMethodCall('setIntegrations', [$integrations]); |
143 | 141 | }
|
144 | 142 |
|
145 | 143 | /**
|
|
0 commit comments