Skip to content

Commit 6d3c8f9

Browse files
authored
Add the path of the project dir to the default value of the prefixes option (#434)
1 parent 24b1dac commit 6d3c8f9

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- Add `kernel.project_dir` to `prefixes` default value to trim paths to the project root (#434)
6+
57
## 4.0.1 (2021-01-26)
68

79
- Add missing `capture-soft-fails` option to the XSD schema for the XML config (#417)

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ parameters:
3535
count: 1
3636
path: tests/End2End/End2EndTest.php
3737

38-
-
39-
message: "#^Comparison operation \"\\<\" between 50201 and 40300 is always false\\.$#"
40-
count: 1
41-
path: tests/End2End/End2EndTest.php
42-
4338
-
4439
message: "#^Parameter \\$event of method Sentry\\\\SentryBundle\\\\Tests\\\\EventListener\\\\ErrorListenerTest\\:\\:testHandleExceptionEvent\\(\\) has invalid typehint type Symfony\\\\Component\\\\HttpKernel\\\\Event\\\\GetResponseForExceptionEvent\\.$#"
4540
count: 1

src/DependencyInjection/Configuration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ public function getConfigTreeBuilder(): TreeBuilder
5050
->booleanNode('default_integrations')->end()
5151
->integerNode('send_attempts')->min(0)->end()
5252
->arrayNode('prefixes')
53+
->defaultValue(array_merge(['%kernel.project_dir%'], array_filter(explode(\PATH_SEPARATOR, get_include_path() ?: ''))))
5354
->scalarPrototype()->end()
5455
->end()
5556
->floatNode('sample_rate')

tests/DependencyInjection/ConfigurationTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ final class ConfigurationTest extends TestCase
1515
{
1616
public function testProcessConfigurationWithDefaultConfiguration(): void
1717
{
18+
$defaultPrefixes = array_filter(explode(\PATH_SEPARATOR, get_include_path() ?: ''));
19+
1820
$expectedBundleDefaultConfig = [
1921
'register_error_listener' => true,
2022
'options' => [
2123
'integrations' => [],
22-
'prefixes' => [],
24+
'prefixes' => array_merge(['%kernel.project_dir%'], $defaultPrefixes),
2325
'environment' => '%kernel.environment%',
2426
'release' => PrettyVersions::getRootPackageVersion()->getPrettyVersion(),
2527
'tags' => [],

tests/End2End/End2EndTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ private function assertLastEventIdIsNull(KernelBrowser $client): void
255255

256256
private function skipIfMessengerIsMissing(): void
257257
{
258-
if (!interface_exists(MessageBusInterface::class) || Kernel::VERSION_ID < 40300) {
258+
if (!interface_exists(MessageBusInterface::class)) {
259259
$this->markTestSkipped('Messenger missing');
260260
}
261261
}

0 commit comments

Comments
 (0)