Skip to content

Commit

Permalink
Fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Apr 22, 2024
1 parent 78773a4 commit 2d5c7e9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Entities.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ public function toHTML(bool $allowTelegramTags = false): string
foreach ($this->entities as $entity) {
['offset' => $offset, 'length' => $length] = $entity;
$insertions[$offset] ??= '';
/** @psalm-suppress PossiblyUndefinedArrayOffset */
/** @psalm-suppress PossiblyUndefinedArrayOffset, DocblockTypeContradiction */
$insertions[$offset] .= match ($entity['type']) {
'bold' => '<b>',
'italic' => '<i>',
Expand All @@ -390,6 +390,7 @@ public function toHTML(bool $allowTelegramTags = false): string
default => '',
};
$offset += $length;
/** @psalm-suppress DocblockTypeContradiction */
$insertions[$offset] = match ($entity['type']) {
"bold" => '</b>',
"italic" => '</i>',
Expand Down

0 comments on commit 2d5c7e9

Please sign in to comment.