Fix php8.1 deprecation notices

This commit is contained in:
Alexander Pankratov 2022-04-18 01:50:39 +03:00
parent 9dc3fc208a
commit afc83e3fb8
2 changed files with 5 additions and 2 deletions

View File

@ -85,7 +85,7 @@ abstract class AbstractApiController
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);

View File

@ -115,8 +115,11 @@ class ApiExtensions
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>',