Skip to content

Commit 7caa57e

Browse files
committed
SentryTestCommand > Define command name in config
This fixes a deprecation on Symfony 6.1: ``` Since symfony/console 6.1: Relying on the static property "$defaultName" for setting a command name is deprecated. Add the "Symfony\Component\Console\Attribute\AsCommand" attribute to the "Sentry\SentryBundle\Command\SentryTestCommand" class instead. ```
1 parent d1d2895 commit 7caa57e

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/Command/SentryTestCommand.php

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

1212
class SentryTestCommand extends Command
1313
{
14-
protected static $defaultName = 'sentry:test';
15-
1614
protected function execute(InputInterface $input, OutputInterface $output): int
1715
{
1816
$currentHub = SentrySdk::getCurrentHub();

src/Resources/config/services.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
</service>
8989

9090
<service id="Sentry\SentryBundle\Command\SentryTestCommand" class="Sentry\SentryBundle\Command\SentryTestCommand">
91-
<tag name="console.command" />
91+
<tag name="console.command" command="sentry:test" />
9292
</service>
9393

9494
<service id="Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverConnectionFactoryInterface" alias="Sentry\SentryBundle\Tracing\Doctrine\DBAL\TracingDriverConnectionFactory" />

0 commit comments

Comments
 (0)