diff --git a/src/Localization/LocalizedString.php b/src/Localization/LocalizedString.php index 7901db0..18235b0 100644 --- a/src/Localization/LocalizedString.php +++ b/src/Localization/LocalizedString.php @@ -4,31 +4,43 @@ namespace Fykosak\Utils\Localization; +/** + * @template L of string + */ class LocalizedString { /** - * @phpstan-var array + * @phpstan-var array */ private array $texts; /** - * @phpstan-param array $texts + * @phpstan-param array $texts */ public function __construct(array $texts) { $this->texts = $texts; } + /** + * @phpstan-param L $lang + */ public function __get(string $lang): ?string { return $this->getText($lang); } + /** + * @phpstan-param L $lang + */ public function getText(string $lang): ?string { return $this->texts[$lang] ?? null; } + /** + * @phpstan-return array + */ public function __serialize(): array { return $this->texts;