11<?php
22
3- namespace CSlant \TelegramGitNotifierApp \Http \ Actions ;
3+ namespace CSlant \TelegramGitNotifierApp \Services ;
44
55use CSlant \TelegramGitNotifier \Exceptions \InvalidViewTemplateException ;
6+ use CSlant \TelegramGitNotifier \Exceptions \MessageIsEmptyException ;
67use CSlant \TelegramGitNotifier \Exceptions \SendNotificationException ;
78use CSlant \TelegramGitNotifier \Models \Setting ;
89use CSlant \TelegramGitNotifier \Notifier ;
910use CSlant \TelegramGitNotifier \Objects \Validator ;
1011use Symfony \Component \HttpFoundation \Request ;
1112
12- class SendNotificationAction
13+ class NotificationService
1314{
1415 protected Request $ request ;
1516
@@ -36,8 +37,9 @@ public function __construct(
3637 * @return void
3738 * @throws InvalidViewTemplateException
3839 * @throws SendNotificationException
40+ * @throws MessageIsEmptyException
3941 */
40- public function __invoke (): void
42+ public function handle (): void
4143 {
4244 $ eventName = $ this ->notifier ->handleEventFromRequest ($ this ->request );
4345 if (!empty ($ eventName )) {
@@ -51,6 +53,7 @@ public function __invoke(): void
5153 * @return void
5254 * @throws InvalidViewTemplateException
5355 * @throws SendNotificationException
56+ * @throws MessageIsEmptyException
5457 */
5558 private function sendNotification (string $ event ): void
5659 {
@@ -83,7 +86,7 @@ private function sendNotification(string $event): void
8386 * @param string $event
8487 *
8588 * @return bool
86- * @throws InvalidViewTemplateException
89+ * @throws InvalidViewTemplateException|MessageIsEmptyException
8790 */
8891 private function validateAccessEvent (string $ event ): bool
8992 {
0 commit comments