File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ class SetWebhook extends Command
3030 public function handle (): void
3131 {
3232 try {
33- $ log = ( new WebhookService ())-> setWebhook ();
33+ $ webhookService = new WebhookService ();
3434
35- $ this ->info ($ log );
35+ $ this ->info ($ webhookService -> setWebhook () );
3636 } catch (WebhookException $ e ) {
3737 $ this ->error ($ e ->getMessage ());
3838 }
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ class WebhookService
99{
1010 protected Webhook $ webhook ;
1111
12- public function __construct ()
12+ public function __construct (? Webhook $ webhook = null )
1313 {
14- $ this ->webhook = new Webhook ();
14+ $ this ->webhook = $ webhook ?? new Webhook ();
1515 $ this ->webhook ->setToken (config ('telegram-git-notifier.bot.token ' ));
1616 $ this ->webhook ->setUrl (config ('telegram-git-notifier.app.url ' ));
1717 }
You can’t perform that action at this time.
0 commit comments