From 646c77c4ba87bb3938def8cbddf76095c47fcec7 Mon Sep 17 00:00:00 2001 From: netkas Date: Wed, 6 Nov 2024 15:02:43 -0500 Subject: [PATCH] Move UpdateEvent to Events and remove unused import --- src/TgBotLib/Bot.php | 2 +- src/TgBotLib/Enums/EventType.php | 4 ++-- src/TgBotLib/Events/BusinessConnectionEvent.php | 1 - src/TgBotLib/Events/BusinessMessageEvent.php | 1 - src/TgBotLib/Events/CallbackQueryEvent.php | 1 - src/TgBotLib/Events/ChannelPostEvent.php | 1 - src/TgBotLib/Events/ChatBoostEvent.php | 1 - src/TgBotLib/Events/ChatJoinRequestEvent.php | 1 - src/TgBotLib/Events/ChatMemberUpdatedEvent.php | 1 - src/TgBotLib/Events/ChosenInlineResultEvent.php | 1 - src/TgBotLib/Events/CommandEvent.php | 1 - src/TgBotLib/Events/DeletedBusinessMessagesEvent.php | 1 - src/TgBotLib/Events/EditedBusinessMessageEvent.php | 1 - src/TgBotLib/Events/EditedChannelPostEvent.php | 1 - src/TgBotLib/Events/EditedMessageEvent.php | 1 - src/TgBotLib/Events/InlineQueryEvent.php | 1 - src/TgBotLib/Events/MessageEvent.php | 1 - src/TgBotLib/Events/MessageReactionCountEvent.php | 1 - src/TgBotLib/Events/MessageReactionEvent.php | 1 - src/TgBotLib/Events/MyChatMemberUpdatedEvent.php | 1 - src/TgBotLib/Events/PaidMediaPurchasedEvent.php | 1 - src/TgBotLib/Events/PollAnswerEvent.php | 1 - src/TgBotLib/Events/PollEvent.php | 1 - src/TgBotLib/Events/PreCheckoutQueryEvent.php | 1 - src/TgBotLib/Events/RemovedChatBoostEvent.php | 1 - src/TgBotLib/Events/ShippingQueryEvent.php | 1 - src/TgBotLib/{Abstracts => Events}/UpdateEvent.php | 2 +- 27 files changed, 4 insertions(+), 28 deletions(-) rename src/TgBotLib/{Abstracts => Events}/UpdateEvent.php (96%) diff --git a/src/TgBotLib/Bot.php b/src/TgBotLib/Bot.php index a558f96..16ee3e5 100644 --- a/src/TgBotLib/Bot.php +++ b/src/TgBotLib/Bot.php @@ -13,13 +13,13 @@ use InvalidArgumentException; use ReflectionClass; use TgBotLib\Abstracts\Method; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Classes\Logger; use TgBotLib\Enums\EventType; use TgBotLib\Enums\Methods; use TgBotLib\Enums\Types\ChatActionType; use TgBotLib\Enums\Types\ParseMode; use TgBotLib\Events\CommandEvent; + use TgBotLib\Events\UpdateEvent; use TgBotLib\Exceptions\TelegramException; use TgBotLib\Objects\BotCommand; use TgBotLib\Objects\BotCommandScope; diff --git a/src/TgBotLib/Enums/EventType.php b/src/TgBotLib/Enums/EventType.php index b07ac97..eb41d73 100644 --- a/src/TgBotLib/Enums/EventType.php +++ b/src/TgBotLib/Enums/EventType.php @@ -2,7 +2,6 @@ namespace TgBotLib\Enums; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Events\BusinessConnectionEvent; use TgBotLib\Events\BusinessMessageEvent; use TgBotLib\Events\CallbackQueryEvent; @@ -21,12 +20,13 @@ use TgBotLib\Events\MessageReactionCountEvent; use TgBotLib\Events\MessageReactionEvent; use TgBotLib\Events\MyChatMemberUpdatedEvent; + use TgBotLib\Events\PaidMediaPurchasedEvent; use TgBotLib\Events\PollAnswerEvent; use TgBotLib\Events\PollEvent; - use TgBotLib\Events\PaidMediaPurchasedEvent; use TgBotLib\Events\PreCheckoutQueryEvent; use TgBotLib\Events\RemovedChatBoostEvent; use TgBotLib\Events\ShippingQueryEvent; + use TgBotLib\Events\UpdateEvent; use TgBotLib\Objects\Update; enum EventType : string diff --git a/src/TgBotLib/Events/BusinessConnectionEvent.php b/src/TgBotLib/Events/BusinessConnectionEvent.php index 53f2b47..33abe70 100644 --- a/src/TgBotLib/Events/BusinessConnectionEvent.php +++ b/src/TgBotLib/Events/BusinessConnectionEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\BusinessConnection; diff --git a/src/TgBotLib/Events/BusinessMessageEvent.php b/src/TgBotLib/Events/BusinessMessageEvent.php index ac7b2e1..20020ea 100644 --- a/src/TgBotLib/Events/BusinessMessageEvent.php +++ b/src/TgBotLib/Events/BusinessMessageEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Message; diff --git a/src/TgBotLib/Events/CallbackQueryEvent.php b/src/TgBotLib/Events/CallbackQueryEvent.php index 368bef7..b10aa3a 100644 --- a/src/TgBotLib/Events/CallbackQueryEvent.php +++ b/src/TgBotLib/Events/CallbackQueryEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\CallbackQuery; diff --git a/src/TgBotLib/Events/ChannelPostEvent.php b/src/TgBotLib/Events/ChannelPostEvent.php index b1a2d89..60ed622 100644 --- a/src/TgBotLib/Events/ChannelPostEvent.php +++ b/src/TgBotLib/Events/ChannelPostEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Message; diff --git a/src/TgBotLib/Events/ChatBoostEvent.php b/src/TgBotLib/Events/ChatBoostEvent.php index a15ff5b..0f5996f 100644 --- a/src/TgBotLib/Events/ChatBoostEvent.php +++ b/src/TgBotLib/Events/ChatBoostEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\ChatBoostUpdated; diff --git a/src/TgBotLib/Events/ChatJoinRequestEvent.php b/src/TgBotLib/Events/ChatJoinRequestEvent.php index a1a7987..0f70e24 100644 --- a/src/TgBotLib/Events/ChatJoinRequestEvent.php +++ b/src/TgBotLib/Events/ChatJoinRequestEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\ChatJoinRequest; diff --git a/src/TgBotLib/Events/ChatMemberUpdatedEvent.php b/src/TgBotLib/Events/ChatMemberUpdatedEvent.php index f53066c..79c9ae5 100644 --- a/src/TgBotLib/Events/ChatMemberUpdatedEvent.php +++ b/src/TgBotLib/Events/ChatMemberUpdatedEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\ChatMemberUpdated; diff --git a/src/TgBotLib/Events/ChosenInlineResultEvent.php b/src/TgBotLib/Events/ChosenInlineResultEvent.php index f607fb7..85e0565 100644 --- a/src/TgBotLib/Events/ChosenInlineResultEvent.php +++ b/src/TgBotLib/Events/ChosenInlineResultEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Inline\ChosenInlineResult; diff --git a/src/TgBotLib/Events/CommandEvent.php b/src/TgBotLib/Events/CommandEvent.php index dd21f2d..6c4706d 100644 --- a/src/TgBotLib/Events/CommandEvent.php +++ b/src/TgBotLib/Events/CommandEvent.php @@ -3,7 +3,6 @@ namespace TgBotLib\Events; use OptsLib\Parse; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Message; diff --git a/src/TgBotLib/Events/DeletedBusinessMessagesEvent.php b/src/TgBotLib/Events/DeletedBusinessMessagesEvent.php index 79938fc..8ee1738 100644 --- a/src/TgBotLib/Events/DeletedBusinessMessagesEvent.php +++ b/src/TgBotLib/Events/DeletedBusinessMessagesEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\BusinessMessagesDeleted; diff --git a/src/TgBotLib/Events/EditedBusinessMessageEvent.php b/src/TgBotLib/Events/EditedBusinessMessageEvent.php index f55abe9..d409851 100644 --- a/src/TgBotLib/Events/EditedBusinessMessageEvent.php +++ b/src/TgBotLib/Events/EditedBusinessMessageEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Message; diff --git a/src/TgBotLib/Events/EditedChannelPostEvent.php b/src/TgBotLib/Events/EditedChannelPostEvent.php index ac5bfb9..f954412 100644 --- a/src/TgBotLib/Events/EditedChannelPostEvent.php +++ b/src/TgBotLib/Events/EditedChannelPostEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Message; diff --git a/src/TgBotLib/Events/EditedMessageEvent.php b/src/TgBotLib/Events/EditedMessageEvent.php index 88fc592..ce68440 100644 --- a/src/TgBotLib/Events/EditedMessageEvent.php +++ b/src/TgBotLib/Events/EditedMessageEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Message; diff --git a/src/TgBotLib/Events/InlineQueryEvent.php b/src/TgBotLib/Events/InlineQueryEvent.php index 4fbc187..07505f4 100644 --- a/src/TgBotLib/Events/InlineQueryEvent.php +++ b/src/TgBotLib/Events/InlineQueryEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Inline\InlineQuery; diff --git a/src/TgBotLib/Events/MessageEvent.php b/src/TgBotLib/Events/MessageEvent.php index 321bb73..95d5f72 100644 --- a/src/TgBotLib/Events/MessageEvent.php +++ b/src/TgBotLib/Events/MessageEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Message; diff --git a/src/TgBotLib/Events/MessageReactionCountEvent.php b/src/TgBotLib/Events/MessageReactionCountEvent.php index aada357..64aa034 100644 --- a/src/TgBotLib/Events/MessageReactionCountEvent.php +++ b/src/TgBotLib/Events/MessageReactionCountEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\MessageReactionCountUpdated; diff --git a/src/TgBotLib/Events/MessageReactionEvent.php b/src/TgBotLib/Events/MessageReactionEvent.php index 812426b..62743da 100644 --- a/src/TgBotLib/Events/MessageReactionEvent.php +++ b/src/TgBotLib/Events/MessageReactionEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\MessageReactionUpdated; diff --git a/src/TgBotLib/Events/MyChatMemberUpdatedEvent.php b/src/TgBotLib/Events/MyChatMemberUpdatedEvent.php index bba6189..32f707d 100644 --- a/src/TgBotLib/Events/MyChatMemberUpdatedEvent.php +++ b/src/TgBotLib/Events/MyChatMemberUpdatedEvent.php @@ -3,7 +3,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\ChatMemberUpdated; diff --git a/src/TgBotLib/Events/PaidMediaPurchasedEvent.php b/src/TgBotLib/Events/PaidMediaPurchasedEvent.php index e64515f..5d3cec3 100644 --- a/src/TgBotLib/Events/PaidMediaPurchasedEvent.php +++ b/src/TgBotLib/Events/PaidMediaPurchasedEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Payments\PaidMediaPurchased; diff --git a/src/TgBotLib/Events/PollAnswerEvent.php b/src/TgBotLib/Events/PollAnswerEvent.php index 393a4c1..46ba9cb 100644 --- a/src/TgBotLib/Events/PollAnswerEvent.php +++ b/src/TgBotLib/Events/PollAnswerEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\PollAnswer; diff --git a/src/TgBotLib/Events/PollEvent.php b/src/TgBotLib/Events/PollEvent.php index f718a34..73da9e9 100644 --- a/src/TgBotLib/Events/PollEvent.php +++ b/src/TgBotLib/Events/PollEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Poll; diff --git a/src/TgBotLib/Events/PreCheckoutQueryEvent.php b/src/TgBotLib/Events/PreCheckoutQueryEvent.php index 6ca2331..8b719ed 100644 --- a/src/TgBotLib/Events/PreCheckoutQueryEvent.php +++ b/src/TgBotLib/Events/PreCheckoutQueryEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Payments\PreCheckoutQuery; diff --git a/src/TgBotLib/Events/RemovedChatBoostEvent.php b/src/TgBotLib/Events/RemovedChatBoostEvent.php index e751360..70906b0 100644 --- a/src/TgBotLib/Events/RemovedChatBoostEvent.php +++ b/src/TgBotLib/Events/RemovedChatBoostEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\ChatBoostRemoved; diff --git a/src/TgBotLib/Events/ShippingQueryEvent.php b/src/TgBotLib/Events/ShippingQueryEvent.php index 124b2a7..78b4aa0 100644 --- a/src/TgBotLib/Events/ShippingQueryEvent.php +++ b/src/TgBotLib/Events/ShippingQueryEvent.php @@ -2,7 +2,6 @@ namespace TgBotLib\Events; - use TgBotLib\Abstracts\UpdateEvent; use TgBotLib\Enums\EventType; use TgBotLib\Objects\Payments\ShippingQuery; diff --git a/src/TgBotLib/Abstracts/UpdateEvent.php b/src/TgBotLib/Events/UpdateEvent.php similarity index 96% rename from src/TgBotLib/Abstracts/UpdateEvent.php rename to src/TgBotLib/Events/UpdateEvent.php index 83e426a..ebac3bd 100644 --- a/src/TgBotLib/Abstracts/UpdateEvent.php +++ b/src/TgBotLib/Events/UpdateEvent.php @@ -1,6 +1,6 @@