mirror of
https://github.com/danog/TelegramApiServer.git
synced 2024-11-26 11:54:42 +01:00
Cleanup
This commit is contained in:
parent
41d37e28c5
commit
2871122256
@ -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[] */
|
||||
|
@ -4,7 +4,7 @@
|
||||
namespace TelegramApiServer;
|
||||
|
||||
|
||||
class Config
|
||||
final class Config
|
||||
{
|
||||
private static ?Config $instance = null;
|
||||
private array $config;
|
||||
|
@ -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 = '';
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -5,7 +5,7 @@ namespace TelegramApiServer\Controllers;
|
||||
use Exception;
|
||||
use TelegramApiServer\Client;
|
||||
|
||||
class SystemController extends AbstractApiController
|
||||
final class SystemController extends AbstractApiController
|
||||
{
|
||||
/**
|
||||
* Получаем параметры из uri
|
||||
|
@ -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;
|
||||
|
@ -9,7 +9,7 @@ use TelegramApiServer\Client;
|
||||
use TelegramApiServer\Logger;
|
||||
use Throwable;
|
||||
|
||||
class EventObserver
|
||||
final class EventObserver
|
||||
{
|
||||
use ObserverTrait;
|
||||
|
||||
|
@ -5,7 +5,7 @@ namespace TelegramApiServer\EventObservers;
|
||||
use TelegramApiServer\Logger;
|
||||
use Throwable;
|
||||
|
||||
class LogObserver
|
||||
final class LogObserver
|
||||
{
|
||||
use ObserverTrait;
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace TelegramApiServer\Exceptions;
|
||||
|
||||
class NoMediaException extends NoticeException
|
||||
final class NoMediaException extends NoticeException
|
||||
{
|
||||
|
||||
}
|
@ -4,7 +4,7 @@ namespace TelegramApiServer\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class NoticeException extends Exception
|
||||
final class NoticeException extends Exception
|
||||
{
|
||||
|
||||
}
|
@ -4,7 +4,7 @@ namespace TelegramApiServer;
|
||||
|
||||
use RuntimeException;
|
||||
|
||||
class Files
|
||||
final class Files
|
||||
{
|
||||
|
||||
public const SESSION_EXTENSION = '.madeline';
|
||||
|
@ -34,7 +34,7 @@ use const PHP_EOL;
|
||||
*
|
||||
* @author Kévin Dunglas <dunglas@gmail.com>
|
||||
*/
|
||||
class Logger extends AbstractLogger
|
||||
final class Logger extends AbstractLogger
|
||||
{
|
||||
private static ?Logger $instanse = null;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -4,7 +4,7 @@ namespace TelegramApiServer\Migrations;
|
||||
|
||||
use danog\MadelineProto\Magic;
|
||||
|
||||
class StartUpFixes
|
||||
final class StartUpFixes
|
||||
{
|
||||
public static function fix(): void
|
||||
{
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
|
@ -5,7 +5,7 @@ namespace TelegramApiServer\Server;
|
||||
use Amp\Http\Server\Response;
|
||||
use TelegramApiServer\Controllers\AbstractApiController;
|
||||
|
||||
class ErrorResponses
|
||||
final class ErrorResponses
|
||||
{
|
||||
/**
|
||||
* @param int $status
|
||||
|
@ -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;
|
||||
|
@ -18,7 +18,7 @@ use function sprintf;
|
||||
use const SIGINT;
|
||||
use const SIGTERM;
|
||||
|
||||
class Server
|
||||
final class Server
|
||||
{
|
||||
/**
|
||||
* Server constructor.
|
||||
|
Loading…
Reference in New Issue
Block a user