Skip to content

Commit 89e9cc3

Browse files
committed
Revert "Fix styling"
This reverts commit 28baab4.
1 parent ff81cf5 commit 89e9cc3

File tree

6 files changed

+23
-28
lines changed

6 files changed

+23
-28
lines changed

src/Http/Actions/IndexAction.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,11 @@ public function __invoke(): void
6060
{
6161
if ($this->bot->isCallback()) {
6262
$this->handleCallback();
63-
6463
return;
6564
}
6665

6766
if ($this->shouldHandleCommand()) {
6867
$this->handleCommand();
69-
7068
return;
7169
}
7270

src/Services/CallbackService.php

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function create(Bot $bot): self
4343
public function answerBackButton(string $callback): void
4444
{
4545
$callback = str_replace(SettingConstant::SETTING_BACK, '', $callback);
46-
46+
4747
$result = match ($callback) {
4848
'settings' => $this->handleSettingsBack(),
4949
'settings.custom_events.github' => $this->handleGithubEventsBack(),
@@ -54,14 +54,13 @@ public function answerBackButton(string $callback): void
5454

5555
if ($result === null) {
5656
$this->bot->answerCallbackQuery(__('tg-notifier::app.unknown_callback'));
57-
5857
return;
5958
}
6059

6160
['view' => $view, 'markup' => $markup] = $result;
6261
$this->bot->editMessageText($view, ['reply_markup' => $markup]);
6362
}
64-
63+
6564
/**
6665
* Handle settings back button.
6766
*
@@ -74,7 +73,7 @@ private function handleSettingsBack(): array
7473
'markup' => $this->bot->settingMarkup(),
7574
];
7675
}
77-
76+
7877
/**
7978
* Handle GitHub events back button.
8079
*
@@ -87,7 +86,7 @@ private function handleGithubEventsBack(): array
8786
'markup' => $this->bot->eventMarkup(),
8887
];
8988
}
90-
89+
9190
/**
9291
* Handle GitLab events back button.
9392
*
@@ -100,7 +99,7 @@ private function handleGitlabEventsBack(): array
10099
'markup' => $this->bot->eventMarkup(null, 'gitlab'),
101100
];
102101
}
103-
102+
104103
/**
105104
* Handle menu back button.
106105
*
@@ -143,7 +142,6 @@ private function handleCustomEvents(string $callback): bool
143142
}
144143

145144
$this->bot->eventHandle($callback);
146-
147145
return true;
148146
}
149147

@@ -157,7 +155,6 @@ private function handleBackButton(string $callback): bool
157155
}
158156

159157
$this->answerBackButton($callback);
160-
161158
return true;
162159
}
163160

src/Services/CommandService.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use CSlant\TelegramGitNotifier\Exceptions\EntryNotFoundException;
1010
use CSlant\TelegramGitNotifier\Exceptions\MessageIsEmptyException;
1111
use Illuminate\Support\Facades\Config;
12+
use Telegram\Telegram as TelegramSDK;
1213

1314
class CommandService
1415
{
@@ -40,7 +41,7 @@ private function sendStartMessage(): void
4041
$firstName = $this->bot->telegram->FirstName() ?: 'there';
4142
$reply = view("$this->viewNamespace::tools.start", ['first_name' => $firstName]);
4243
$imagePath = __DIR__.'/../../resources/images/telegram-git-notifier-laravel.png';
43-
44+
4445
$this->bot->sendPhoto($imagePath, ['caption' => $reply]);
4546
}
4647

@@ -56,11 +57,11 @@ public function handle(): void
5657
$command = trim($text, '/');
5758

5859
$handlers = [
59-
'start' => fn () => $this->handleStart(),
60-
'menu' => fn () => $this->handleMenu(),
61-
'settings' => fn () => $this->handleSettings(),
62-
'set_menu' => fn () => $this->handleSetMenu(),
63-
'default' => fn () => $this->handleDefault($command),
60+
'start' => fn() => $this->handleStart(),
61+
'menu' => fn() => $this->handleMenu(),
62+
'settings' => fn() => $this->handleSettings(),
63+
'set_menu' => fn() => $this->handleSetMenu(),
64+
'default' => fn() => $this->handleDefault($command),
6465
];
6566

6667
$handler = $handlers[$command] ?? $this->handleToolCommand($command) ?? $handlers['default'];
@@ -118,7 +119,7 @@ private function handleSetMenu(): void
118119
private function handleToolCommand(string $command): ?callable
119120
{
120121
$toolCommands = ['token', 'id', 'usage', 'server'];
121-
122+
122123
if (!in_array($command, $toolCommands, true)) {
123124
return null;
124125
}

src/Services/NotificationService.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414

1515
class NotificationService
1616
{
17-
/**
18-
* @var array<string, array<int|string>>
17+
/**
18+
* @var array<string, array<int|string>>
1919
*/
2020
private array $chatIds = [];
2121

@@ -51,11 +51,11 @@ private function initialize(): void
5151
public function handle(): void
5252
{
5353
$eventName = $this->notifier->handleEventFromRequest($this->request);
54-
54+
5555
if ($eventName === null) {
5656
return;
5757
}
58-
58+
5959
$this->sendNotification($eventName);
6060
}
6161

@@ -92,7 +92,6 @@ private function sendToRecipients(string $chatId, array $threads): void
9292
{
9393
if (empty($threads)) {
9494
$this->sendToChat($chatId);
95-
9695
return;
9796
}
9897

@@ -107,7 +106,7 @@ private function sendToRecipients(string $chatId, array $threads): void
107106
private function sendToChat(string $chatId): void
108107
{
109108
$this->notifier->sendNotify(null, [
110-
'chat_id' => $chatId,
109+
'chat_id' => $chatId
111110
]);
112111
}
113112

@@ -146,7 +145,7 @@ private function sendToThread(string $chatId, string $threadId): void
146145
private function isValidEvent(string $event): bool
147146
{
148147
$payload = $this->notifier->setPayload($this->request, $event);
149-
148+
150149
if (empty($payload) || !is_object($payload)) {
151150
return false;
152151
}
@@ -163,7 +162,7 @@ private function isValidEvent(string $event): bool
163162
private function validateEventAccess(string $event, object $payload): bool
164163
{
165164
$validator = new Validator($this->setting, $this->notifier->event);
166-
165+
167166
return $validator->isAccessEvent(
168167
$this->notifier->event->platform,
169168
$event,

src/Services/WebhookService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ private function initializeWebhook(): void
7373
if ($this->webhook->getToken() === null) {
7474
$this->webhook->setToken(Config::get(self::CONFIG_PREFIX . '.bot.token'));
7575
}
76-
76+
7777
if ($this->webhook->getUrl() === null) {
7878
$this->webhook->setUrl(Config::get(self::CONFIG_PREFIX . '.app.url'));
7979
}

src/Traits/Markup.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
namespace CSlant\LaravelTelegramGitNotifier\Traits;
66

7-
use Illuminate\Support\Facades\Config;
87
use Telegram as TelegramSDK;
8+
use Illuminate\Support\Facades\Config;
99

1010
/**
1111
* Trait Markup
12-
*
12+
*
1313
* Provides common markup generation methods for Telegram bot interfaces.
1414
*/
1515
trait Markup

0 commit comments

Comments
 (0)