Skip to content

Commit

Permalink
NotifyDeploymentCommand > Define command name in config
Browse files Browse the repository at this point in the history
This fixes a deprecation on Symfony 6.1:
The "Symfony\Component\Console\Command\Command::$defaultName" property is considered final. You should not override it in "Ekino\NewRelicBundle\Command\NotifyDeploymentCommand".
  • Loading branch information
ruudk committed May 27, 2022
1 parent aa29fd8 commit f09b40f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions Command/NotifyDeploymentCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class NotifyDeploymentCommand extends Command
public const EXIT_UNAUTHORIZED = 2;
public const EXIT_HTTP_ERROR = 3;

protected static $defaultName = 'newrelic:notify-deployment';

private $newrelic;

public function __construct(Config $newrelic)
Expand Down
4 changes: 4 additions & 0 deletions Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
<prototype namespace="Ekino\NewRelicBundle\NewRelic\" resource="../../NewRelic/*" />
<prototype namespace="Ekino\NewRelicBundle\TransactionNamingStrategy\" resource="../../TransactionNamingStrategy/*" />

<service id="Ekino\NewRelicBundle\Command\NotifyDeploymentCommand" autowire="true" autoconfigure="true">
<tag name="console.command" command="newrelic:notify-deployment" />
</service>

<service id="Ekino\NewRelicBundle\NewRelic\AdaptiveInteractor">
<argument type="service" id="Ekino\NewRelicBundle\NewRelic\NewRelicInteractor" />
<argument type="service" id="Ekino\NewRelicBundle\NewRelic\BlackholeInteractor" />
Expand Down

0 comments on commit f09b40f

Please sign in to comment.