Skip to content

Commit 7c35397

Browse files
committed
Add integrations configuration option
1 parent c792525 commit 7c35397

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/DependencyInjection/Configuration.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,20 @@ public function getConfigTreeBuilder()
8383
->end()
8484
->scalarNode('http_proxy')
8585
->end()
86-
// TODO -- integrations
86+
->arrayNode('integrations')
87+
->prototype('scalar')
88+
->validate()
89+
->ifTrue(function ($value): bool {
90+
if (! is_string($value)) {
91+
return true;
92+
}
93+
94+
return '@' !== substr($value, 0, 1);
95+
})
96+
->thenInvalid('Expecting service reference, got %s')
97+
->end()
98+
->end()
99+
->end()
87100
->scalarNode('logger')
88101
->end()
89102
->integerNode('max_breadcrumbs')

test/DependencyInjection/ConfigurationTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class ConfigurationTest extends TestCase
1313
{
14-
public const SUPPORTED_SENTRY_OPTIONS_COUNT = 21;
14+
public const SUPPORTED_SENTRY_OPTIONS_COUNT = 22;
1515

1616
public function testDataProviderIsMappingTheRightNumberOfOptions(): void
1717
{
@@ -53,6 +53,7 @@ public function testConfigurationDefaults(): void
5353
'%kernel.cache_dir%',
5454
'%kernel.root_dir%/../vendor',
5555
],
56+
'integrations' => $defaultSdkValues->getIntegrations(),
5657
'excluded_exceptions' => $defaultSdkValues->getExcludedExceptions(),
5758
'prefixes' => $defaultSdkValues->getPrefixes(),
5859
'project_root' => '%kernel.root_dir%/..',
@@ -95,6 +96,7 @@ public function optionValuesProvider(): array
9596
['error_types', E_ALL],
9697
['http_proxy', '1.2.3.4:5678'],
9798
['in_app_exclude', ['some/path']],
99+
['integrations', []],
98100
['excluded_exceptions', [\Throwable::class]],
99101
['logger', 'some-logger'],
100102
['max_breadcrumbs', 15],
@@ -143,9 +145,11 @@ public function invalidValuesProvider(): array
143145
['enable_compression', 'string'],
144146
['environment', ''],
145147
['error_types', []],
148+
['excluded_exceptions', 'some-string'],
146149
['http_proxy', []],
147150
['in_app_exclude', 'some/single/path'],
148-
['excluded_exceptions', 'some-string'],
151+
['integrations', [1]],
152+
['integrations', 'a string'],
149153
['logger', []],
150154
['max_breadcrumbs', -1],
151155
['max_breadcrumbs', 'string'],

0 commit comments

Comments
 (0)