Skip to content

Commit a116feb

Browse files
committed
Fix \E_STRICT deprecation
1 parent 21ab633 commit a116feb

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

tests/DependencyInjection/Fixtures/php/error_types.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
/** @var ContainerBuilder $container */
88
$container->loadFromExtension('sentry', [
99
'options' => [
10-
'error_types' => \E_ALL & ~(\E_NOTICE | \E_STRICT | \E_DEPRECATED),
10+
// 2048 is \E_STRICT which has been deprecated in PHP 8.4 so we should not reference it directly to prevent deprecation notices
11+
'error_types' => \E_ALL & ~(\E_NOTICE | 2048 | \E_DEPRECATED),
1112
],
1213
]);

tests/DependencyInjection/Fixtures/xml/error_types.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
https://sentry.io/schema/dic/sentry-symfony https://sentry.io/schema/dic/sentry-symfony/sentry-1.0.xsd">
88

99
<sentry:config dsn="https://[email protected]/0">
10-
<sentry:options error-types="E_ALL &amp; ~(E_NOTICE|E_STRICT|E_DEPRECATED)" />
10+
<sentry:options error-types="E_ALL &amp; ~(E_NOTICE|2048|E_DEPRECATED)" />
1111
</sentry:config>
1212
</container>

tests/DependencyInjection/SentryExtensionTest.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ public function testErrorTypesOptionIsParsedFromStringToIntegerValue(): void
288288
$container = $this->createContainerFromFixture('error_types');
289289
$optionsDefinition = $container->getDefinition('sentry.client.options');
290290

291-
$this->assertSame(\E_ALL & ~(\E_NOTICE | \E_STRICT | \E_DEPRECATED), $optionsDefinition->getArgument(0)['error_types']);
291+
// 2048 is \E_STRICT which has been deprecated in PHP 8.4 so we should not reference it directly to prevent deprecation notices
292+
$this->assertSame(\E_ALL & ~(\E_NOTICE | 2048 | \E_DEPRECATED), $optionsDefinition->getArgument(0)['error_types']);
292293
}
293294

294295
/**

0 commit comments

Comments
 (0)