Skip to content

Commit

Permalink
Fix php8.1 deprecation notices
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Apr 17, 2022
1 parent 9dc3fc2 commit afc83e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Controllers/AbstractApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function process()
private function resolveRequest(): \Generator
{
$query = $this->request->getUri()->getQuery();
$contentType = $this->request->getHeader('Content-Type');
$contentType = (string)$this->request->getHeader('Content-Type');

parse_str($query, $get);

Expand Down
5 changes: 4 additions & 1 deletion src/MadelineProtoExtensions/ApiExtensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ private static function hasMedia(array $message = [], bool $allowWebPage = false
return true;
}

public function formatMessage(string $message = null, array $entities = []): ?string
public function formatMessage(?string $message = null, array $entities = []): ?string
{
if ($message === null) {
return null;
}
$html = [
'messageEntityItalic' => '<i>%s</i>',
'messageEntityBold' => '<strong>%s</strong>',
Expand Down

0 comments on commit afc83e3

Please sign in to comment.