Skip to content

Commit

Permalink
Change include defaults (#311)
Browse files Browse the repository at this point in the history
* Use empty default for in_app_include

* Fix related tests

* Add changelog entry
  • Loading branch information
Jean85 committed Feb 3, 2020
1 parent 486c4cd commit 15a0e90
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## Unreleased

- Change default of `in_app_include` to empty, due to getsentry/sentry-php#958 (#311)

## 3.4.2 (2020-01-29)
- Remove space from classname used with `class_alias` (#313)
Expand Down
4 changes: 1 addition & 3 deletions src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->cannotBeEmpty();
$optionsChildNodes->scalarNode('error_types');
$optionsChildNodes->arrayNode('in_app_include')
->defaultValue([
'%kernel.project_dir%/src',
])
->defaultValue([])
->prototype('scalar');
$optionsChildNodes->arrayNode('in_app_exclude')
->defaultValue([
Expand Down
4 changes: 1 addition & 3 deletions test/DependencyInjection/ConfigurationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public function testConfigurationDefaults(): void
'options' => [
'class_serializers' => [],
'environment' => '%kernel.environment%',
'in_app_include' => [
'%kernel.project_dir%/src',
],
'in_app_include' => [],
'in_app_exclude' => [
'%kernel.cache_dir%',
'%kernel.project_dir%/vendor',
Expand Down
5 changes: 2 additions & 3 deletions test/DependencyInjection/SentryExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,11 @@ public function testOptionsDefaultValues(): void
$container = $this->getContainer();
$options = $this->getOptionsFrom($container);

$vendorDir = '/dir/project/root/vendor';
$this->assertContains('/dir/project/root/src', $options->getInAppIncludedPaths());
$this->assertEmpty($options->getInAppIncludedPaths());

$this->assertNull($options->getDsn());
$this->assertSame('test', $options->getEnvironment());
$this->assertSame([realpath('./var/cache'), $vendorDir], $options->getInAppExcludedPaths());
$this->assertSame([realpath('./var/cache'), '/dir/project/root/vendor'], $options->getInAppExcludedPaths());

$this->assertSame(1, $container->getParameter('sentry.listener_priorities.request'));
$this->assertSame(1, $container->getParameter('sentry.listener_priorities.sub_request'));
Expand Down

0 comments on commit 15a0e90

Please sign in to comment.