$entities */ public function __construct(private readonly array $entities = []) { } public function get(string $type): TranslatableEntityInterface { if (!isset($this->entities[$type])) { throw new \InvalidArgumentException(sprintf('Unsupported translation entity type "%s".', $type)); } return $this->entities[$type]; } /** * @return string[] */ public function getTypes(): array { return array_keys($this->entities); } }