Skip to content

Commit

Permalink
Merge pull request #672 from defstudio/php-8.4
Browse files Browse the repository at this point in the history
support for php 8.4
  • Loading branch information
fabio-ivona authored Nov 26, 2024
2 parents 267a5e7 + 8327551 commit b3a1f9a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/DTO/InlineQueryResultArticle.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class InlineQueryResultArticle extends InlineQueryResult
protected bool|null $hideUrl = null;
protected string|null $parseMode = null;

public static function make(string $id, string $title, string $message = null): InlineQueryResultArticle
public static function make(string $id, string $title, ?string $message = null): InlineQueryResultArticle
{
$result = new InlineQueryResultArticle();
$result->id = $id;
Expand Down
3 changes: 2 additions & 1 deletion src/Handlers/WebhookHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use DefStudio\Telegraph\DTO\InlineQuery;
use DefStudio\Telegraph\DTO\Message;
use DefStudio\Telegraph\DTO\Reaction;
use DefStudio\Telegraph\DTO\ReactionType;
use DefStudio\Telegraph\DTO\User;
use DefStudio\Telegraph\Exceptions\TelegramWebhookException;
use DefStudio\Telegraph\Keyboard\Keyboard;
Expand Down Expand Up @@ -44,7 +45,7 @@ abstract class WebhookHandler
protected ChatJoinRequest|null $chatJoinRequest = null;

/**
* @var Collection<string, string>|Collection<int, array<string, string>>
* @var Collection<string, string>|Collection<int, array<string, string>>|Collection<array-key, ReactionType>
*/
protected Collection $data;

Expand Down
4 changes: 2 additions & 2 deletions src/Keyboard/Keyboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ public static function fromArray(array $arrayKeyboard): Keyboard
}

if (array_key_exists('switch_inline_query', $button)) {
$rowButton = $rowButton->switchInlineQuery($button['switch_inline_query'] ?? '');
$rowButton = $rowButton->switchInlineQuery($button['switch_inline_query']);
}

if (array_key_exists('switch_inline_query_current_chat', $button)) {
$rowButton = $rowButton->switchInlineQuery($button['switch_inline_query_current_chat'] ?? '')->currentChat();
$rowButton = $rowButton->switchInlineQuery($button['switch_inline_query_current_chat'])->currentChat();
}

$rowButtons[] = $rowButton;
Expand Down
2 changes: 1 addition & 1 deletion src/Telegraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public function send(): TelegraphResponse
return TelegraphResponse::fromResponse($response);
}

public function dispatch(string $queue = null): PendingDispatch
public function dispatch(?string $queue = null): PendingDispatch
{
return $this->dispatchRequestToTelegram($queue);
}
Expand Down

0 comments on commit b3a1f9a

Please sign in to comment.