diff --git a/composer.json b/composer.json index 54a55db..a69c41d 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "maglnet/composer-require-checker": "^4.5", "phpunit/phpunit": "^10.1", "roave/infection-static-analysis-plugin": "^1.16", - "symfony/console": "^6.2", + "symfony/console": "^7.2", "symfony/http-client": "^7.0", "vimeo/psalm": "^6.8", "yiisoft/definitions": "^3.3", diff --git a/src/Console/GetUpdatesCommand.php b/src/Console/GetUpdatesCommand.php index 871f1bf..e0ea8d5 100644 --- a/src/Console/GetUpdatesCommand.php +++ b/src/Console/GetUpdatesCommand.php @@ -11,17 +11,16 @@ use Botasis\Runtime\Update\UpdateFactory; use Psr\Log\LoggerInterface; use Psr\Log\NullLogger; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Throwable; +#[AsCommand(name: 'botasis:telegram:updates', description: 'Get updates from the bot and process them')] final class GetUpdatesCommand extends Command { - protected static $defaultName = 'botasis/telegram/updates'; - protected static $defaultDescription = 'Get updates from the bot and process them'; - public function __construct( private readonly ClientInterface $client, private readonly Application $application, diff --git a/src/Console/SetTelegramWebhookCommand.php b/src/Console/SetTelegramWebhookCommand.php index 4030c4a..946a63e 100644 --- a/src/Console/SetTelegramWebhookCommand.php +++ b/src/Console/SetTelegramWebhookCommand.php @@ -7,6 +7,7 @@ use Botasis\Client\Telegram\Client\ClientInterface; use Botasis\Client\Telegram\Request\TelegramRequest; use InvalidArgumentException; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; @@ -17,11 +18,9 @@ use function str_contains; use function str_starts_with; +#[AsCommand(name: 'botasis:telegram:set-webhook', description: 'Set TG webhook address')] final class SetTelegramWebhookCommand extends Command { - protected static $defaultName = 'botasis/telegram/set-webhook'; - protected static $defaultDescription = 'Set TG webhook address'; - public function __construct( private readonly ClientInterface $client, private readonly QuestionHelper $questionHelper,