diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8a7a07c0..ad144de3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
## Unreleased
+- Fix compatibility issue with Symfony >= 6.1.0 (#635)
## 4.2.10 (2022-05-17)
diff --git a/src/Command/SentryTestCommand.php b/src/Command/SentryTestCommand.php
index 809b14b1..582f37c2 100644
--- a/src/Command/SentryTestCommand.php
+++ b/src/Command/SentryTestCommand.php
@@ -11,8 +11,6 @@
class SentryTestCommand extends Command
{
- protected static $defaultName = 'sentry:test';
-
protected function execute(InputInterface $input, OutputInterface $output): int
{
$currentHub = SentrySdk::getCurrentHub();
diff --git a/src/Resources/config/services.xml b/src/Resources/config/services.xml
index 8fd79790..41fe3633 100644
--- a/src/Resources/config/services.xml
+++ b/src/Resources/config/services.xml
@@ -88,7 +88,7 @@
-
+
diff --git a/tests/Command/SentryTestCommandTest.php b/tests/Command/SentryTestCommandTest.php
index f60a9c6c..41e0023d 100644
--- a/tests/Command/SentryTestCommandTest.php
+++ b/tests/Command/SentryTestCommandTest.php
@@ -115,8 +115,11 @@ public function testExecuteFailsDueToMissingClient(): void
private function executeCommand(): CommandTester
{
+ $command = new SentryTestCommand();
+ $command->setName('sentry:test');
+
$application = new Application();
- $application->add(new SentryTestCommand());
+ $application->add($command);
$command = $application->find('sentry:test');
$commandTester = new CommandTester($command);