Skip to content

Commit

Permalink
Drop 8.1. Refactor Telegram Class.
Browse files Browse the repository at this point in the history
  • Loading branch information
irazasyed committed Oct 16, 2024
1 parent e3c4769 commit 095fb6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
16 changes: 4 additions & 12 deletions src/Telegram.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 095fb6d

Please sign in to comment.