[TOOLS] Continue raising PHPStan level to 6

This commit is contained in:
2022-10-19 22:39:17 +01:00
parent c31f3d4997
commit 2fd46ca886
89 changed files with 646 additions and 278 deletions

View File

@@ -134,6 +134,9 @@ class Language extends Entity
return self::getById($note->getLanguageId());
}
/**
* @return array<string, string>
*/
public static function getLanguageChoices(): array
{
$langs = Cache::getHashMap(
@@ -144,6 +147,8 @@ class Language extends Entity
return array_merge(...F\map(array_values($langs), fn ($l) => $l->toChoiceFormat()));
}
/**
* @return array<string, string> */
public function toChoiceFormat(): array
{
return [_m($this->getLongDisplay()) => $this->getLocale()];
@@ -152,6 +157,8 @@ class Language extends Entity
/**
* Get all the available languages as well as the languages $actor
* prefers and are appropriate for posting in/to $context_actor
*
* @return array{array<string, string>, array<string, string>}
*/
public static function getSortedLanguageChoices(?Actor $actor, ?Actor $context_actor, ?bool $use_short_display): array
{