InlineQueryResultArticle::fromArray($data), InlineQueryResultType::PHOTO => InlineQueryResultPhoto::fromArray($data), InlineQueryResultType::GIF => InlineQueryResultGif::fromArray($data), InlineQueryResultType::MPEG_4_GIF => InlineQueryResultMpeg4Gif::fromArray($data), InlineQueryResultType::VIDEO => InlineQueryResultVideo::fromArray($data), InlineQueryResultType::AUDIO => InlineQueryResultAudio::fromArray($data), InlineQueryResultType::VOICE => InlineQueryResultVoice::fromArray($data), InlineQueryResultType::DOCUMENT => InlineQueryResultDocument::fromArray($data), InlineQueryResultType::LOCATION => InlineQueryResultLocation::fromArray($data), InlineQueryResultType::VENUE => InlineQueryResultVenue::fromArray($data), InlineQueryResultType::CONTACT => InlineQueryResultContact::fromArray($data), InlineQueryResultType::GAME => InlineQueryResultGame::fromArray($data), default => throw new InvalidArgumentException(sprintf('The type of the InlineQueryResult is invalid, got "%s", expected one of "%s"', $data['type'], implode('", "', InlineQueryResultType::ALL))), }; } }