diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index aa7de4f..b316479 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: true matrix: - php: ['8.1', '8.2', '8.3'] + php: ['8.2', '8.3'] dependencies: [lowest, highest] experimental: [false] diff --git a/src/Telegram.php b/src/Telegram.php index 4da7f78..f1efbde 100644 --- a/src/Telegram.php +++ b/src/Telegram.php @@ -14,22 +14,14 @@ */ class Telegram { - /** @var HttpClient HTTP Client */ - protected readonly HttpClient $http; - - /** @var null|string Telegram Bot API Token. */ - protected ?string $token; - /** @var string Telegram Bot API Base URI */ protected string $apiBaseUri; public function __construct( - ?string $token = null, - HttpClient $httpClient = new HttpClient, + protected ?string $token = null, + protected HttpClient $http = new HttpClient, string $apiBaseUri = 'https://api.telegram.org' ) { - $this->token = $token; - $this->http = $httpClient; $this->setApiBaseUri($apiBaseUri); } @@ -115,9 +107,9 @@ public function sendMessage(array $params): ?ResponseInterface * * @throws CouldNotSendNotification */ - public function sendFile(array $params, string|array $type, bool $multipart = false): ?ResponseInterface + public function sendFile(array $params, string $type, bool $multipart = false): ?ResponseInterface { - return $this->sendRequest('send'.Str::studly((array) $type[0]), $params, $multipart); + return $this->sendRequest('send'.Str::studly($type), $params, $multipart); } /**