@@ -34,6 +34,7 @@ public function __construct(private BotLocator $botLocator, private UrlGenerator
3434 parent ::__construct ();
3535 }
3636
37+ #[\Override]
3738 protected function configure (): void
3839 {
3940 $ this
@@ -51,22 +52,21 @@ protected function configure(): void
5152 ;
5253 }
5354
55+ #[\Override]
5456 protected function execute (InputInterface $ input , OutputInterface $ output ): int
5557 {
5658 $ io = new SymfonyStyle ($ input , $ output );
5759
5860 $ certificateFile = null ;
5961 if ($ certificate = $ input ->getArgument ('certificate ' )) {
6062 if (!is_file ($ certificate ) || !is_readable ($ certificate )) {
61- throw new \RuntimeException (sprintf ('Can \'t read certificate file "%s" ' , $ certificate ));
63+ throw new \RuntimeException (\ sprintf ('Can \'t read certificate file "%s" ' , $ certificate ));
6264 }
6365
6466 $ certificateFile = new \CURLFile ($ certificate );
6567 }
6668
67- /** @var string|null $urlOrHostname */
6869 $ urlOrHostname = $ input ->getArgument ('urlOrHostname ' );
69- /** @var string|null $bot */
7070 $ bot = $ input ->getOption ('bot ' );
7171
7272 $ allowedUpdates = $ input ->getOption ('allowedUpdateType ' );
@@ -108,7 +108,7 @@ private function setWebhook(
108108 ?\CURLFile $ certificateFile = null ,
109109 ?array $ allowedUpdates = null
110110 ): bool {
111- $ io ->block (sprintf ('Bot "%s" ' , $ name ));
111+ $ io ->block (\ sprintf ('Bot "%s" ' , $ name ));
112112
113113 if (!$ urlOrHostname ) {
114114 $ url = $ this ->urlGenerator ->generate ('_telegram_bot_webhook ' , [
@@ -127,17 +127,17 @@ private function setWebhook(
127127 } catch (RouteNotFoundException $ e ) {
128128 $ helpUrl = 'https://github.com/BoShurik/TelegramBotBundle#add-routing-for-webhook ' ;
129129 $ message = "We could not find the webhook route. Read on \n<options=bold>%s</> \nhow to add the route or use symfony/flex. " ;
130- $ io ->block (messages: sprintf ($ message , $ helpUrl ), escape: false );
130+ $ io ->block (messages: \ sprintf ($ message , $ helpUrl ), escape: false );
131131
132132 return false ;
133133 }
134134 } else {
135135 $ url = $ urlOrHostname ;
136136 }
137137
138- $ api ->setWebhook ($ url , $ certificateFile , null , self ::MAX_CONNECTIONS , json_encode ($ allowedUpdates ));
138+ $ api ->setWebhook ($ url , $ certificateFile , null , self ::MAX_CONNECTIONS , ( string ) json_encode ($ allowedUpdates ));
139139
140- $ message = sprintf ('Webhook URL has been set to <options=bold>%s</> ' , $ url );
140+ $ message = \ sprintf ('Webhook URL has been set to <options=bold>%s</> ' , $ url );
141141 $ io ->block ($ message , 'OK ' , 'fg=black;bg=green ' , ' ' , true , false );
142142
143143 return true ;
0 commit comments