<commit_before><?php
/**
 * @author <NAME> <<EMAIL>>
 */

namespace Tigris\Telegram;

use Tigris\Telegram\Types\Arrays\ChatMemberArray;
use Tigris\Telegram\Types\Arrays\UpdateArray;
use Tigris\Telegram\Types\Chat;
use Tigris\Telegram\Types\ChatMember;
use Tigris\Telegram\Types\File;
use Tigris\Telegram\Types\Inline\InlineQueryResult;
use Tigris\Telegram\Types\Interfaces\ReplyMarkupInterface;
use Tigris\Telegram\Types\Message;
use Tigris\Telegram\Types\Scalar\ScalarBoolean;
use Tigris\Telegram\Types\Scalar\ScalarInteger;
use Tigris\Telegram\Types\Update;
use Tigris\Telegram\Types\User;
use Tigris\Telegram\Types\UserProfilePhotos;

class ApiWrapper
{
    const PARSE_MODE_MARKDOWN = 'Markdown';
    const PARSE_MODE_HTML = 'HTML';

    /** @see sendChatAction() */
    const CHAT_ACTION_TYPING = 'typing';
    const CHAT_ACTION_UPLOAD_PHOTO = 'upload_photo';
    const CHAT_ACTION_RECORD_VIDEO = 'record_video';
    const CHAT_ACTION_UPLOAD_VIDEO = 'upload_video';
    const CHAT_ACTION_RECORD_AUDIO = 'record_audio';
    const CHAT_ACTION_UPLOAD_AUDIO = 'upload_audio';
    const CHAT_ACTION_UPLOAD_DOCUMENT = 'upload_document';
    const CHAT_ACTION_FIND_LOCATION = 'find_location';

    /** @var ApiClient */
    protected $apiClient;

    /**
     * @param ApiClient $apiClient
     */
    public function __construct(ApiClient $apiClient)
    {
        $this->setApiClient($apiClient);
    }

    /**
     * @param ApiClient $apiClient
     */
    public function setApiClient(ApiClient $apiClient)
    {
        $this->apiClient = $apiClient;<commit_msg>added dynamic call resolver<commit_after><?php
/**
 * @author <NAME> <<EMAIL>>
 */

namespace Tigris\Telegram;

use Tigris\Telegram\Types\Arrays\ChatMemberArray;
use Tigris\Telegram\Types\Arrays\UpdateArray;
use Tigris\Telegram\Types\Chat;
use Tigris\Telegram\Types\ChatMember;
use Tigris\Telegram\Types\File;
use Tigris\Telegram\Types\Inline\InlineQueryResult;
use Tigris\Telegram\Types\Interfaces\ReplyMarkupInterface;
use Tigris\Telegram\Types\Interfaces\TypeInterface;
use Tigris\Telegram\Types\Message;
use Tigris\Telegram\Types\Scalar\ScalarBoolean;
use Tigris\Telegram\Types\Scalar\ScalarInteger;
use Tigris\Telegram\Types\Update;
use Tigris\Telegram\Types\User;
use Tigris\Telegram\Types\UserProfilePhotos;

/**
 * Class ApiWrapper
 * @package Tigris\Telegram
 *
 *
 */
class ApiWrapper
{
    const PARSE_MODE_MARKDOWN = 'Markdown';
    const PARSE_MODE_HTML = 'HTML';

    /** @see sendChatAction() */
    const CHAT_ACTION_TYPING = 'typing';
    const CHAT_ACTION_UPLOAD_PHOTO = 'upload_photo';
    const CHAT_ACTION_RECORD_VIDEO = 'record_video';
    const CHAT_ACTION_UPLOAD_VIDEO = 'upload_video';
    const CHAT_ACTION_RECORD_AUDIO = 'record_audio';
    const CHAT_ACTION_UPLOAD_AUDIO = 'upload_audio';
    const CHAT_ACTION_UPLOAD_DOCUMENT = 'upload_document';
    const CHAT_ACTION_FIND_LOCATION = 'find_location';

    const METHODS = [
        'getMe' => User::class,
    ];

    /** @var ApiClient */
    protected $apiClient;

    /**
     * @param ApiClient $apiClient
     */
    public function __construct(ApiClient $apiClient)
    {
        $this->setApiClient($apiClient);
    }

    /**
     * @param ApiClient $apiClient
     */
    public function setApiClient(ApiClient $apiClient)
    {
        $this->apiClient = $apiClient;
    }

    function __call($name, $arguments)
    {
        if (!array_key_exists($name,self::METHODS)) {
            throw new \BadMethodCallException('Unsupported method: ' . $name);
        }
        /** @var TypeInterface $type */
        $type = self::METHODS[$name];
        return $type::parse($this->apiClient->call($name, $arguments));
{'fraction_non_alphanumeric': 0.11753476956640306, 'fraction_numerical': 0.0, 'mean_word_length': 3.923489932885906, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3280270', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1230, 'n_words': 204}