diff --git a/src/Client.php b/src/Client.php index 5959146..4dab926 100644 --- a/src/Client.php +++ b/src/Client.php @@ -15,7 +15,7 @@ use RuntimeException; use TelegramApiServer\EventObservers\EventHandler; use TelegramApiServer\EventObservers\EventObserver; -class Client +final class Client { public static Client $self; /** @var API[] */ diff --git a/src/Config.php b/src/Config.php index d2e4845..024c276 100644 --- a/src/Config.php +++ b/src/Config.php @@ -4,7 +4,7 @@ namespace TelegramApiServer; -class Config +final class Config { private static ?Config $instance = null; private array $config; diff --git a/src/Controllers/ApiController.php b/src/Controllers/ApiController.php index 61814b8..34b038f 100644 --- a/src/Controllers/ApiController.php +++ b/src/Controllers/ApiController.php @@ -15,7 +15,7 @@ use function Amp\async; use function Amp\delay; use function Amp\Future\awaitAll; -class ApiController extends AbstractApiController +final class ApiController extends AbstractApiController { private ?string $session = ''; diff --git a/src/Controllers/EventsController.php b/src/Controllers/EventsController.php index 9d35878..992b3aa 100644 --- a/src/Controllers/EventsController.php +++ b/src/Controllers/EventsController.php @@ -20,7 +20,7 @@ use TelegramApiServer\EventObservers\EventObserver; use TelegramApiServer\Logger; use Throwable; -class EventsController implements WebsocketClientHandler, WebsocketAcceptor +final class EventsController implements WebsocketClientHandler, WebsocketAcceptor { private const PING_INTERVAL_MS = 10_000; private WebsocketClientGateway $gateway; diff --git a/src/Controllers/LogController.php b/src/Controllers/LogController.php index 0f4bb14..1f6dbf6 100644 --- a/src/Controllers/LogController.php +++ b/src/Controllers/LogController.php @@ -17,7 +17,7 @@ use Revolt\EventLoop; use TelegramApiServer\EventObservers\LogObserver; use TelegramApiServer\Logger; -class LogController implements WebsocketClientHandler, WebsocketAcceptor +final class LogController implements WebsocketClientHandler, WebsocketAcceptor { private const PING_INTERVAL_MS = 10_000; private WebsocketClientGateway $gateway; diff --git a/src/Controllers/SystemController.php b/src/Controllers/SystemController.php index 1159b4c..9ea2831 100644 --- a/src/Controllers/SystemController.php +++ b/src/Controllers/SystemController.php @@ -5,7 +5,7 @@ namespace TelegramApiServer\Controllers; use Exception; use TelegramApiServer\Client; -class SystemController extends AbstractApiController +final class SystemController extends AbstractApiController { /** * Получаем параметры из uri diff --git a/src/EventObservers/EventHandler.php b/src/EventObservers/EventHandler.php index 9f3565a..b231d72 100644 --- a/src/EventObservers/EventHandler.php +++ b/src/EventObservers/EventHandler.php @@ -4,7 +4,7 @@ namespace TelegramApiServer\EventObservers; use TelegramApiServer\Files; -class EventHandler extends \danog\MadelineProto\EventHandler +final class EventHandler extends \danog\MadelineProto\EventHandler { public static array $instances = []; private string $sessionName; diff --git a/src/EventObservers/EventObserver.php b/src/EventObservers/EventObserver.php index 70a2112..174c428 100644 --- a/src/EventObservers/EventObserver.php +++ b/src/EventObservers/EventObserver.php @@ -9,7 +9,7 @@ use TelegramApiServer\Client; use TelegramApiServer\Logger; use Throwable; -class EventObserver +final class EventObserver { use ObserverTrait; diff --git a/src/EventObservers/LogObserver.php b/src/EventObservers/LogObserver.php index dd71990..c457deb 100644 --- a/src/EventObservers/LogObserver.php +++ b/src/EventObservers/LogObserver.php @@ -5,7 +5,7 @@ namespace TelegramApiServer\EventObservers; use TelegramApiServer\Logger; use Throwable; -class LogObserver +final class LogObserver { use ObserverTrait; diff --git a/src/Exceptions/NoMediaException.php b/src/Exceptions/NoMediaException.php index 2e17e87..73476ff 100644 --- a/src/Exceptions/NoMediaException.php +++ b/src/Exceptions/NoMediaException.php @@ -2,7 +2,7 @@ namespace TelegramApiServer\Exceptions; -class NoMediaException extends NoticeException +final class NoMediaException extends NoticeException { } \ No newline at end of file diff --git a/src/Exceptions/NoticeException.php b/src/Exceptions/NoticeException.php index 54e8d22..f488fb6 100644 --- a/src/Exceptions/NoticeException.php +++ b/src/Exceptions/NoticeException.php @@ -4,7 +4,7 @@ namespace TelegramApiServer\Exceptions; use Exception; -class NoticeException extends Exception +final class NoticeException extends Exception { } \ No newline at end of file diff --git a/src/Files.php b/src/Files.php index 30cfdb4..e8a6164 100644 --- a/src/Files.php +++ b/src/Files.php @@ -4,7 +4,7 @@ namespace TelegramApiServer; use RuntimeException; -class Files +final class Files { public const SESSION_EXTENSION = '.madeline'; diff --git a/src/Logger.php b/src/Logger.php index 3cfd1f5..7bf2951 100644 --- a/src/Logger.php +++ b/src/Logger.php @@ -34,7 +34,7 @@ use const PHP_EOL; * * @author Kévin Dunglas */ -class Logger extends AbstractLogger +final class Logger extends AbstractLogger { private static ?Logger $instanse = null; diff --git a/src/MadelineProtoExtensions/ApiExtensions.php b/src/MadelineProtoExtensions/ApiExtensions.php index 874bf17..074b241 100644 --- a/src/MadelineProtoExtensions/ApiExtensions.php +++ b/src/MadelineProtoExtensions/ApiExtensions.php @@ -15,7 +15,7 @@ use TelegramApiServer\EventObservers\EventHandler; use TelegramApiServer\Exceptions\NoMediaException; use function Amp\delay; -class ApiExtensions +final class ApiExtensions { private MadelineProto\Api $madelineProto; diff --git a/src/MadelineProtoExtensions/SystemApiExtensions.php b/src/MadelineProtoExtensions/SystemApiExtensions.php index a78a223..c119003 100644 --- a/src/MadelineProtoExtensions/SystemApiExtensions.php +++ b/src/MadelineProtoExtensions/SystemApiExtensions.php @@ -13,7 +13,7 @@ use function Amp\async; use function Amp\File\deleteFile; use function Amp\Future\awaitAll; -class SystemApiExtensions +final class SystemApiExtensions { private Client $client; diff --git a/src/Migrations/StartUpFixes.php b/src/Migrations/StartUpFixes.php index f454f57..a443dea 100644 --- a/src/Migrations/StartUpFixes.php +++ b/src/Migrations/StartUpFixes.php @@ -4,7 +4,7 @@ namespace TelegramApiServer\Migrations; use danog\MadelineProto\Magic; -class StartUpFixes +final class StartUpFixes { public static function fix(): void { diff --git a/src/Server/AccessLoggerMiddleware.php b/src/Server/AccessLoggerMiddleware.php index 14eb60e..28ca0db 100644 --- a/src/Server/AccessLoggerMiddleware.php +++ b/src/Server/AccessLoggerMiddleware.php @@ -9,7 +9,7 @@ use Amp\Http\Server\Response; use Psr\Log\LoggerInterface as PsrLogger; use Psr\Log\LogLevel; -class AccessLoggerMiddleware implements Middleware +final class AccessLoggerMiddleware implements Middleware { public function __construct( private readonly PsrLogger $logger, diff --git a/src/Server/Authorization.php b/src/Server/Authorization.php index b4db07e..07c28d3 100644 --- a/src/Server/Authorization.php +++ b/src/Server/Authorization.php @@ -9,7 +9,7 @@ use Amp\Http\Server\RequestHandler; use Amp\Http\Server\Response; use TelegramApiServer\Config; -class Authorization implements Middleware +final class Authorization implements Middleware { private array $ipWhitelist; private int $selfIp; diff --git a/src/Server/ErrorResponses.php b/src/Server/ErrorResponses.php index ba5307d..1ce3b46 100644 --- a/src/Server/ErrorResponses.php +++ b/src/Server/ErrorResponses.php @@ -5,7 +5,7 @@ namespace TelegramApiServer\Server; use Amp\Http\Server\Response; use TelegramApiServer\Controllers\AbstractApiController; -class ErrorResponses +final class ErrorResponses { /** * @param int $status diff --git a/src/Server/Router.php b/src/Server/Router.php index 7e96fb1..82650a3 100644 --- a/src/Server/Router.php +++ b/src/Server/Router.php @@ -16,7 +16,7 @@ use TelegramApiServer\MadelineProtoExtensions\ApiExtensions; use TelegramApiServer\MadelineProtoExtensions\SystemApiExtensions; use function Amp\Http\Server\Middleware\stackMiddleware; -class Router +final class Router { private \Amp\Http\Server\Router $router; private SocketHttpServer $server; diff --git a/src/Server/Server.php b/src/Server/Server.php index 36eccf8..6309dd2 100644 --- a/src/Server/Server.php +++ b/src/Server/Server.php @@ -18,7 +18,7 @@ use function sprintf; use const SIGINT; use const SIGTERM; -class Server +final class Server { /** * Server constructor.