From c63b80df27423a14c0501a575d9c5b07dbc6b9e8 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Fri, 20 Sep 2019 18:08:53 +0200 Subject: [PATCH 1/8] Simplify check in Configuration --- src/DependencyInjection/Configuration.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 6f25af07..2498e919 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -80,13 +80,13 @@ public function getConfigTreeBuilder(): TreeBuilder ->prototype('scalar') ->validate() ->ifTrue(function ($value): bool { - if (! is_string($value)) { + if (! is_string($value) && '' != $value) { return true; } - return '@' !== substr($value, 0, 1); + return '@' !== $value[0]; }) - ->thenInvalid('Expecting service reference, got %s'); + ->thenInvalid('Expecting service reference, got "%s"'); $optionsChildNodes->scalarNode('logger'); $optionsChildNodes->integerNode('max_breadcrumbs') ->min(1); From 50b7043bf92622f555c9366a22016a2576b3c882 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sat, 21 Sep 2019 22:45:33 +0200 Subject: [PATCH 2/8] Add class_serializers to the options --- src/DependencyInjection/Configuration.php | 16 +++++++++ .../DependencyInjection/ConfigurationTest.php | 36 +++++++++++++++++-- 2 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 2498e919..35506d38 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -57,6 +57,11 @@ public function getConfigTreeBuilder(): TreeBuilder if (PrettyVersions::getVersion('sentry/sentry')->getPrettyVersion() !== '2.0.0') { $optionsChildNodes->booleanNode('capture_silenced_errors'); } + if ($this->classSerializersAreSupported()) { + $optionsChildNodes->arrayNode('class_serializers') + ->defaultValue([]) + ->prototype('scalar'); + } $optionsChildNodes->integerNode('context_lines') ->min(0) ->max(99); @@ -163,4 +168,15 @@ private function isNotAValidCallback(): \Closure return true; }; } + + private function classSerializersAreSupported(): bool + { + try { + new Options(['class_serializers' => []]); + + return true; + } catch (\Throwable $throwable) { + return false; + } + } } diff --git a/test/DependencyInjection/ConfigurationTest.php b/test/DependencyInjection/ConfigurationTest.php index 783a2740..d5d3a2e8 100644 --- a/test/DependencyInjection/ConfigurationTest.php +++ b/test/DependencyInjection/ConfigurationTest.php @@ -19,7 +19,7 @@ public function testDataProviderIsMappingTheRightNumberOfOptions(): void $providerData = $this->optionValuesProvider(); $supportedOptions = \array_unique(\array_column($providerData, 0)); - $expectedCount = self::SUPPORTED_SENTRY_OPTIONS_COUNT; + $expectedCount = $this->getSupportedOptionsCount(); if (PrettyVersions::getVersion('sentry/sentry')->getPrettyVersion() !== '2.0.0') { ++$expectedCount; @@ -38,7 +38,7 @@ public function testInvalidDataProviderIsMappingTheRightNumberOfOptions(): void $supportedOptions = \array_unique(\array_column($providerData, 0)); $this->assertCount( - self::SUPPORTED_SENTRY_OPTIONS_COUNT, + $this->getSupportedOptionsCount(), $supportedOptions, 'Provider for invalid configuration options mismatch: ' . PHP_EOL . print_r($supportedOptions, true) ); @@ -76,6 +76,10 @@ public function testConfigurationDefaults(): void $expectedDefaults['options']['in_app_exclude'][1] = '%kernel.project_dir%/vendor'; } + if ($this->classSerializersAreSupported()) { + $expectedDefaults['options']['class_serializers'] = []; + } + $this->assertEquals($expectedDefaults, $processed); $this->assertArrayNotHasKey('server_name', $processed['options'], 'server_name has to be fetched at runtime, not before (see #181)'); } @@ -127,6 +131,10 @@ public function optionValuesProvider(): array $options[] = ['capture_silenced_errors', true]; } + if ($this->classSerializersAreSupported()) { + $options[] = ['class_serializers', ['count']]; + } + return $options; } @@ -154,6 +162,10 @@ public function invalidValuesProvider(): array ['before_send', [$this, 'is not a callable']], ['before_send', false], ['before_send', -1], + ['class_serializers', 'this is not a callable'], + ['class_serializers', [$this, 'is not a callable']], + ['class_serializers', false], + ['class_serializers', -1], ['context_lines', -1], ['context_lines', 99999], ['context_lines', 'string'], @@ -192,4 +204,24 @@ private function processConfiguration(array $values): array return $processor->processConfiguration(new Configuration(), ['sentry' => $values]); } + + private function classSerializersAreSupported(): bool + { + try { + new Options(['class_serializers' => []]); + + return true; + } catch (\Throwable $throwable) { + return false; + } + } + + private function getSupportedOptionsCount(): int + { + if ($this->classSerializersAreSupported()) { + return self::SUPPORTED_SENTRY_OPTIONS_COUNT + 1; + } + + return self::SUPPORTED_SENTRY_OPTIONS_COUNT; + } } From 8850436974e53834f308c59b59ffca4cc063a41f Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sun, 22 Sep 2019 16:03:24 +0200 Subject: [PATCH 3/8] Add all tests to class_serializers option --- src/DependencyInjection/SentryExtension.php | 31 ++++++++++--------- test/BaseTestCase.php | 30 ++++++++++++++++++ .../DependencyInjection/ConfigurationTest.php | 24 ++------------ .../SentryExtensionTest.php | 21 +++++++++++-- 4 files changed, 67 insertions(+), 39 deletions(-) create mode 100644 test/BaseTestCase.php diff --git a/src/DependencyInjection/SentryExtension.php b/src/DependencyInjection/SentryExtension.php index 751387e5..fbb52b77 100644 --- a/src/DependencyInjection/SentryExtension.php +++ b/src/DependencyInjection/SentryExtension.php @@ -14,7 +14,6 @@ use Symfony\Component\Config\FileLocator; use Symfony\Component\Console\ConsoleEvents; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\HttpKernel\DependencyInjection\Extension; @@ -97,11 +96,22 @@ private function passConfigurationToOptions(ContainerBuilder $container, array $ } if (\array_key_exists('before_send', $processedOptions)) { - $this->mapCallableValue($options, 'setBeforeSendCallback', $processedOptions['before_send']); + $beforeSendCallable = $this->valueToCallable($processedOptions['before_send']); + $options->addMethodCall('setBeforeSendCallback', [$beforeSendCallable]); } if (\array_key_exists('before_breadcrumb', $processedOptions)) { - $this->mapCallableValue($options, 'setBeforeBreadcrumbCallback', $processedOptions['before_breadcrumb']); + $beforeBreadcrumbCallable = $this->valueToCallable($processedOptions['before_breadcrumb']); + $options->addMethodCall('setBeforeBreadcrumbCallback', [$beforeBreadcrumbCallable]); + } + + if (\array_key_exists('class_serializers', $processedOptions)) { + $classSerializers = []; + foreach ($processedOptions['class_serializers'] as $class => $serializer) { + $classSerializers[$class] = $this->valueToCallable($serializer); + } + + $options->addMethodCall('setClassSerializers', [$classSerializers]); } if (\array_key_exists('integrations', $processedOptions)) { @@ -114,20 +124,13 @@ private function passConfigurationToOptions(ContainerBuilder $container, array $ } } - /** - * @param Definition $options - * @param string $method - * @param callable|string $optionValue - */ - private function mapCallableValue(Definition $options, string $method, $optionValue): void + private function valueToCallable($value) { - if (is_string($optionValue) && 0 === strpos($optionValue, '@')) { - $beforeSend = new Reference(substr($optionValue, 1)); - } else { - $beforeSend = $optionValue; + if (is_string($value) && 0 === strpos($value, '@')) { + return new Reference(substr($value, 1)); } - $options->addMethodCall($method, [$beforeSend]); + return $value; } /** diff --git a/test/BaseTestCase.php b/test/BaseTestCase.php new file mode 100644 index 00000000..ee8b6024 --- /dev/null +++ b/test/BaseTestCase.php @@ -0,0 +1,30 @@ + []]); + + return true; + } catch (\Throwable $throwable) { + return false; + } + } + + protected function getSupportedOptionsCount(): int + { + if ($this->classSerializersAreSupported()) { + return ConfigurationTest::SUPPORTED_SENTRY_OPTIONS_COUNT + 1; + } + + return ConfigurationTest::SUPPORTED_SENTRY_OPTIONS_COUNT; + } +} diff --git a/test/DependencyInjection/ConfigurationTest.php b/test/DependencyInjection/ConfigurationTest.php index d5d3a2e8..e786e48f 100644 --- a/test/DependencyInjection/ConfigurationTest.php +++ b/test/DependencyInjection/ConfigurationTest.php @@ -3,14 +3,14 @@ namespace Sentry\SentryBundle\Test\DependencyInjection; use Jean85\PrettyVersions; -use PHPUnit\Framework\TestCase; use Sentry\Options; use Sentry\SentryBundle\DependencyInjection\Configuration; +use Sentry\SentryBundle\Test\BaseTestCase; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\Definition\Processor; use Symfony\Component\HttpKernel\Kernel; -class ConfigurationTest extends TestCase +class ConfigurationTest extends BaseTestCase { public const SUPPORTED_SENTRY_OPTIONS_COUNT = 23; @@ -204,24 +204,4 @@ private function processConfiguration(array $values): array return $processor->processConfiguration(new Configuration(), ['sentry' => $values]); } - - private function classSerializersAreSupported(): bool - { - try { - new Options(['class_serializers' => []]); - - return true; - } catch (\Throwable $throwable) { - return false; - } - } - - private function getSupportedOptionsCount(): int - { - if ($this->classSerializersAreSupported()) { - return self::SUPPORTED_SENTRY_OPTIONS_COUNT + 1; - } - - return self::SUPPORTED_SENTRY_OPTIONS_COUNT; - } } diff --git a/test/DependencyInjection/SentryExtensionTest.php b/test/DependencyInjection/SentryExtensionTest.php index 26d0bd42..b47e9ba2 100644 --- a/test/DependencyInjection/SentryExtensionTest.php +++ b/test/DependencyInjection/SentryExtensionTest.php @@ -3,12 +3,12 @@ namespace Sentry\SentryBundle\Test\DependencyInjection; use Jean85\PrettyVersions; -use PHPUnit\Framework\TestCase; use Sentry\Breadcrumb; use Sentry\Event; use Sentry\Integration\IntegrationInterface; use Sentry\Options; use Sentry\SentryBundle\DependencyInjection\SentryExtension; +use Sentry\SentryBundle\Test\BaseTestCase; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\ContainerBuilder; @@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpKernel\Kernel; -class SentryExtensionTest extends TestCase +class SentryExtensionTest extends BaseTestCase { private const OPTIONS_TEST_PUBLIC_ALIAS = 'sentry.options.public_alias'; @@ -34,7 +34,7 @@ public function testDataProviderIsMappingTheRightNumberOfOptions(): void } $this->assertCount( - $expectedCount, + $this->getSupportedOptionsCount(), $supportedOptions, 'Provider for configuration options mismatch: ' . PHP_EOL . print_r($supportedOptions, true) ); @@ -138,6 +138,16 @@ public function optionsValueProvider(): array $options[] = ['capture_silenced_errors', true, 'shouldCaptureSilencedErrors']; } + if ($this->classSerializersAreSupported()) { + $options['class_serializer'] = [ + 'class_serializers', + [ + self::class => __NAMESPACE__ . '\mockClassSerializer', + ], + 'getClassSerializers', + ]; + } + return $options; } @@ -375,6 +385,11 @@ function mockBeforeBreadcrumb(Breadcrumb $breadcrumb): ?Breadcrumb return null; } +function mockClassSerializer($object) +{ + return ['value' => 'serialized_class']; +} + class CallbackMock { public static function callback() From 36d96fd6ed6a6d1ab7d28f08d7de912afd928ff2 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sun, 22 Sep 2019 16:05:46 +0200 Subject: [PATCH 4/8] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1dc023f..1358e930 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] - Add forward compatibility with Symfony 5 (#235, thanks to @garak) - Fix compatibility with sentry/sentry 2.2+ (#244) + - Add support for `class_serializers` option (#245) ## 3.1.0 - 2019-07-02 - Add support for Symfony 2.8 (#233, thanks to @nocive) From b90e69c57729739f532a1a442e9deb82ab477a3b Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sun, 22 Sep 2019 17:23:57 +0200 Subject: [PATCH 5/8] Fix CS --- src/DependencyInjection/Configuration.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index 35506d38..288fa59c 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -174,9 +174,9 @@ private function classSerializersAreSupported(): bool try { new Options(['class_serializers' => []]); - return true; + return true; } catch (\Throwable $throwable) { - return false; + return false; } } } From 41190ddaf23af126c69ba2a2ee249c678d289920 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sun, 22 Sep 2019 23:50:02 +0200 Subject: [PATCH 6/8] Try to fix tests under prefer-lowest --- src/EventListener/ConsoleListener.php | 1 - src/EventListener/RequestListener.php | 1 - test/BaseTestCase.php | 2 + .../DependencyInjection/ConfigurationTest.php | 92 +++++++++---------- .../SentryExtensionTest.php | 8 +- 5 files changed, 51 insertions(+), 53 deletions(-) diff --git a/src/EventListener/ConsoleListener.php b/src/EventListener/ConsoleListener.php index 71972214..4d47dc8c 100644 --- a/src/EventListener/ConsoleListener.php +++ b/src/EventListener/ConsoleListener.php @@ -3,7 +3,6 @@ namespace Sentry\SentryBundle\EventListener; use Sentry\SentryBundle\SentryBundle; -use Sentry\State\Hub; use Sentry\State\HubInterface; use Sentry\State\Scope; use Symfony\Component\Console\Event\ConsoleCommandEvent; diff --git a/src/EventListener/RequestListener.php b/src/EventListener/RequestListener.php index 06a2a2be..8c36b669 100644 --- a/src/EventListener/RequestListener.php +++ b/src/EventListener/RequestListener.php @@ -3,7 +3,6 @@ namespace Sentry\SentryBundle\EventListener; use Sentry\SentryBundle\SentryBundle; -use Sentry\State\Hub; use Sentry\State\HubInterface; use Sentry\State\Scope; use Symfony\Component\HttpKernel\Event\FilterControllerEvent; diff --git a/test/BaseTestCase.php b/test/BaseTestCase.php index ee8b6024..4b4cbbb6 100644 --- a/test/BaseTestCase.php +++ b/test/BaseTestCase.php @@ -8,6 +8,8 @@ abstract class BaseTestCase extends TestCase { + public const SUPPORTED_SENTRY_OPTIONS_COUNT = 23; + protected function classSerializersAreSupported(): bool { try { diff --git a/test/DependencyInjection/ConfigurationTest.php b/test/DependencyInjection/ConfigurationTest.php index e786e48f..21073fd5 100644 --- a/test/DependencyInjection/ConfigurationTest.php +++ b/test/DependencyInjection/ConfigurationTest.php @@ -12,8 +12,6 @@ class ConfigurationTest extends BaseTestCase { - public const SUPPORTED_SENTRY_OPTIONS_COUNT = 23; - public function testDataProviderIsMappingTheRightNumberOfOptions(): void { $providerData = $this->optionValuesProvider(); @@ -150,52 +148,52 @@ public function testInvalidValues(string $option, $value): void $this->processConfiguration($input); } - public function invalidValuesProvider(): array + public function invalidValuesProvider(): \Generator { - return [ - ['attach_stacktrace', 'string'], - ['before_breadcrumb', 'this is not a callable'], - ['before_breadcrumb', [$this, 'is not a callable']], - ['before_breadcrumb', false], - ['before_breadcrumb', -1], - ['before_send', 'this is not a callable'], - ['before_send', [$this, 'is not a callable']], - ['before_send', false], - ['before_send', -1], - ['class_serializers', 'this is not a callable'], - ['class_serializers', [$this, 'is not a callable']], - ['class_serializers', false], - ['class_serializers', -1], - ['context_lines', -1], - ['context_lines', 99999], - ['context_lines', 'string'], - ['default_integrations', 'true'], - ['default_integrations', 1], - ['enable_compression', 'string'], - ['environment', ''], - ['error_types', []], - ['excluded_exceptions', 'some-string'], - ['http_proxy', []], - ['in_app_exclude', 'some/single/path'], - ['integrations', [1]], - ['integrations', 'a string'], - ['logger', []], - ['max_breadcrumbs', -1], - ['max_breadcrumbs', 'string'], - ['max_value_length', -1], - ['max_value_length', []], - ['prefixes', 'string'], - ['project_root', []], - ['release', []], - ['sample_rate', 1.1], - ['sample_rate', -1], - ['send_attempts', 1.5], - ['send_attempts', 0], - ['send_attempts', -1], - ['send_default_pii', 'false'], - ['server_name', []], - ['tags', 'invalid-unmapped-tag'], - ]; + yield ['attach_stacktrace', 'string']; + yield ['before_breadcrumb', 'this is not a callable']; + yield ['before_breadcrumb', [$this, 'is not a callable']]; + yield ['before_breadcrumb', false]; + yield ['before_breadcrumb', -1]; + yield ['before_send', 'this is not a callable']; + yield ['before_send', [$this, 'is not a callable']]; + yield ['before_send', false]; + yield ['before_send', -1]; + if ($this->classSerializersAreSupported()) { + yield ['class_serializers', 'this is not a callable']; + yield ['class_serializers', [$this, 'is not a callable']]; + yield ['class_serializers', false]; + yield ['class_serializers', -1]; + } + yield ['context_lines', -1]; + yield ['context_lines', 99999]; + yield ['context_lines', 'string']; + yield ['default_integrations', 'true']; + yield ['default_integrations', 1]; + yield ['enable_compression', 'string']; + yield ['environment', '']; + yield ['error_types', []]; + yield ['excluded_exceptions', 'some-string']; + yield ['http_proxy', []]; + yield ['in_app_exclude', 'some/single/path']; + yield ['integrations', [1]]; + yield ['integrations', 'a string']; + yield ['logger', []]; + yield ['max_breadcrumbs', -1]; + yield ['max_breadcrumbs', 'string']; + yield ['max_value_length', -1]; + yield ['max_value_length', []]; + yield ['prefixes', 'string']; + yield ['project_root', []]; + yield ['release', []]; + yield ['sample_rate', 1.1]; + yield ['sample_rate', -1]; + yield ['send_attempts', 1.5]; + yield ['send_attempts', 0]; + yield ['send_attempts', -1]; + yield ['send_default_pii', 'false']; + yield ['server_name', []]; + yield ['tags', 'invalid-unmapped-tag']; } private function processConfiguration(array $values): array diff --git a/test/DependencyInjection/SentryExtensionTest.php b/test/DependencyInjection/SentryExtensionTest.php index b47e9ba2..c4625512 100644 --- a/test/DependencyInjection/SentryExtensionTest.php +++ b/test/DependencyInjection/SentryExtensionTest.php @@ -27,14 +27,14 @@ public function testDataProviderIsMappingTheRightNumberOfOptions(): void $supportedOptions = \array_unique(\array_column($providerData, 0)); // subtracted one is `integration`, which cannot be tested with the provider - $expectedCount = ConfigurationTest::SUPPORTED_SENTRY_OPTIONS_COUNT - 1; + $expectedCount = $this->getSupportedOptionsCount(); - if (PrettyVersions::getVersion('sentry/sentry')->getPrettyVersion() !== '2.0.0') { - ++$expectedCount; + if (PrettyVersions::getVersion('sentry/sentry')->getPrettyVersion() === '2.0.0') { + --$expectedCount; } $this->assertCount( - $this->getSupportedOptionsCount(), + $expectedCount, $supportedOptions, 'Provider for configuration options mismatch: ' . PHP_EOL . print_r($supportedOptions, true) ); From d8f895e187696d6aa9fea6206443d7b0ffcaba01 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Sun, 22 Sep 2019 23:53:04 +0200 Subject: [PATCH 7/8] Revert yield change --- .../DependencyInjection/ConfigurationTest.php | 91 ++++++++++--------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/test/DependencyInjection/ConfigurationTest.php b/test/DependencyInjection/ConfigurationTest.php index 21073fd5..8305c4b8 100644 --- a/test/DependencyInjection/ConfigurationTest.php +++ b/test/DependencyInjection/ConfigurationTest.php @@ -148,52 +148,57 @@ public function testInvalidValues(string $option, $value): void $this->processConfiguration($input); } - public function invalidValuesProvider(): \Generator + public function invalidValuesProvider(): array { - yield ['attach_stacktrace', 'string']; - yield ['before_breadcrumb', 'this is not a callable']; - yield ['before_breadcrumb', [$this, 'is not a callable']]; - yield ['before_breadcrumb', false]; - yield ['before_breadcrumb', -1]; - yield ['before_send', 'this is not a callable']; - yield ['before_send', [$this, 'is not a callable']]; - yield ['before_send', false]; - yield ['before_send', -1]; + $values = [ + ['attach_stacktrace', 'string'], + ['before_breadcrumb', 'this is not a callable'], + ['before_breadcrumb', [$this, 'is not a callable']], + ['before_breadcrumb', false], + ['before_breadcrumb', -1], + ['before_send', 'this is not a callable'], + ['before_send', [$this, 'is not a callable']], + ['before_send', false], + ['before_send', -1], + ['context_lines', -1], + ['context_lines', 99999], + ['context_lines', 'string'], + ['default_integrations', 'true'], + ['default_integrations', 1], + ['enable_compression', 'string'], + ['environment', ''], + ['error_types', []], + ['excluded_exceptions', 'some-string'], + ['http_proxy', []], + ['in_app_exclude', 'some/single/path'], + ['integrations', [1]], + ['integrations', 'a string'], + ['logger', []], + ['max_breadcrumbs', -1], + ['max_breadcrumbs', 'string'], + ['max_value_length', -1], + ['max_value_length', []], + ['prefixes', 'string'], + ['project_root', []], + ['release', []], + ['sample_rate', 1.1], + ['sample_rate', -1], + ['send_attempts', 1.5], + ['send_attempts', 0], + ['send_attempts', -1], + ['send_default_pii', 'false'], + ['server_name', []], + ['tags', 'invalid-unmapped-tag'], + ]; + if ($this->classSerializersAreSupported()) { - yield ['class_serializers', 'this is not a callable']; - yield ['class_serializers', [$this, 'is not a callable']]; - yield ['class_serializers', false]; - yield ['class_serializers', -1]; + $values[] = ['class_serializers', 'this is not a callable']; + $values[] = ['class_serializers', [$this, 'is not a callable']]; + $values[] = ['class_serializers', false]; + $values[] = ['class_serializers', -1]; } - yield ['context_lines', -1]; - yield ['context_lines', 99999]; - yield ['context_lines', 'string']; - yield ['default_integrations', 'true']; - yield ['default_integrations', 1]; - yield ['enable_compression', 'string']; - yield ['environment', '']; - yield ['error_types', []]; - yield ['excluded_exceptions', 'some-string']; - yield ['http_proxy', []]; - yield ['in_app_exclude', 'some/single/path']; - yield ['integrations', [1]]; - yield ['integrations', 'a string']; - yield ['logger', []]; - yield ['max_breadcrumbs', -1]; - yield ['max_breadcrumbs', 'string']; - yield ['max_value_length', -1]; - yield ['max_value_length', []]; - yield ['prefixes', 'string']; - yield ['project_root', []]; - yield ['release', []]; - yield ['sample_rate', 1.1]; - yield ['sample_rate', -1]; - yield ['send_attempts', 1.5]; - yield ['send_attempts', 0]; - yield ['send_attempts', -1]; - yield ['send_default_pii', 'false']; - yield ['server_name', []]; - yield ['tags', 'invalid-unmapped-tag']; + + return $values; } private function processConfiguration(array $values): array From df3905e4fc4e1523a4cf046db32a64980ff68803 Mon Sep 17 00:00:00 2001 From: Alessandro Lai Date: Mon, 23 Sep 2019 09:26:35 +0200 Subject: [PATCH 8/8] Add changelog entry for #243 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1358e930..96128f47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [Unreleased] - Add forward compatibility with Symfony 5 (#235, thanks to @garak) + - Fix Hub initialization for `ErrorListener` (#243, thanks to @teohhanhui) - Fix compatibility with sentry/sentry 2.2+ (#244) - Add support for `class_serializers` option (#245)