Skip to content

Commit bb7d0f8

Browse files
committed
Fix listener registration
1 parent 3d7437a commit bb7d0f8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
- test/
66
ignoreErrors:
77
- "/Call to function method_exists.. with 'Symfony.+' and 'getRootNode' will always evaluate to false./"
8+
- "/Call to function method_exists.. with 'Symfony.+' and 'getThrowable' will always evaluate to false./"
89
- "/Call to function method_exists.. with 'Sentry..Options' and 'getClassSerializers' will always evaluate to false./"
910
- "/Call to function method_exists.. with 'Sentry..Options' and 'getMaxRequestBodySi...' will always evaluate to false./"
1011
- '/Class PHPUnit_Framework_TestCase not found/'

src/DependencyInjection/SentryExtension.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ private function configureErrorListener(ContainerBuilder $container, array $proc
150150
private function tagExceptionListener(ContainerBuilder $container): void
151151
{
152152
$listener = $container->getDefinition(ErrorListener::class);
153-
$method = class_exists(ExceptionEvent::class)
153+
$method = class_exists(ExceptionEvent::class) && method_exists(ExceptionEvent::class, 'getThrowable')
154154
? 'onException'
155155
: 'onKernelException';
156156

0 commit comments

Comments
 (0)