<commit_before><?php

/**
 * TruckersMP REST API Library
 * Website: truckersmp.com
 */

namespace TruckersMP;

use TruckersMP\Helpers\RequestHelper;
use TruckersMP\Models\BansModel;
use TruckersMP\Models\GameTimeModel;
use TruckersMP\Models\PlayerModel;
use TruckersMP\Models\ServersModel;
use TruckersMP\Models\VersionModel;

class Client
{
    const API_ENDPOINT = 'api.truckersmp.com';
    const API_VERSION = 'v2';

    /**
     * @var \TruckersMP\Helpers\RequestHelper
     */
    protected $request;

    /**
     * Client constructor.
     *
     * @param array $config
     * @param bool $secure
     */
    public function __construct(array $config = [], bool $secure = true)
    {
        $scheme = $secure ? 'https' : 'http';
        $url = $scheme . '://' . self::API_ENDPOINT . '/' . self::API_VERSION . '/';

        $this->request = new RequestHelper($url, $config);
    }

    /**
     * Get player information by ID.
     *
     * @param int $id
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\PlayerModel
     */
    public function player(int $id): PlayerModel
    {
        $result = $this->request->execute('player/' . $id);

        return new PlayerModel($result);
    }

    /**
     * Get bans information by player ID.
     *
     * @param int $id
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\BansModel
     */
    public function bans(int $id): BansModel
    {
        $result = $this->request->execute('bans/' . $id);

        return new BansModel($result);
    }

    /**
     * Get server information.
     *
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\ServersModel
     */
    public function servers(): ServersModel
    {
        $result = $this->request->execute('servers');

        return new ServersModel($result);
    }

    /**
     * Get the current game time
     *
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\GameTimeModel
     */
    public function gameTime(): GameTimeModel
    {
        $result = $this->request->execute('game_time');

        return new GameTimeModel($result);
    }

    /**
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\VersionModel
     */
    public function version(): VersionModel
    {
        $result = $this->request->execute('version');

        return new VersionModel($result);
    }
}<commit_msg>Added deprecated tag to the version function<commit_after><?php

/**
 * TruckersMP REST API Library
 * Website: truckersmp.com
 */

namespace TruckersMP;

use TruckersMP\Helpers\RequestHelper;
use TruckersMP\Models\BansModel;
use TruckersMP\Models\GameTimeModel;
use TruckersMP\Models\PlayerModel;
use TruckersMP\Models\ServersModel;
use TruckersMP\Models\VersionModel;

class Client
{
    const API_ENDPOINT = 'api.truckersmp.com';
    const API_VERSION = 'v2';

    /**
     * @var \TruckersMP\Helpers\RequestHelper
     */
    protected $request;

    /**
     * Client constructor.
     *
     * @param array $config
     * @param bool $secure
     */
    public function __construct(array $config = [], bool $secure = true)
    {
        $scheme = $secure ? 'https' : 'http';
        $url = $scheme . '://' . self::API_ENDPOINT . '/' . self::API_VERSION . '/';

        $this->request = new RequestHelper($url, $config);
    }

    /**
     * Get player information by ID.
     *
     * @param int $id
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\PlayerModel
     */
    public function player(int $id): PlayerModel
    {
        $result = $this->request->execute('player/' . $id);

        return new PlayerModel($result);
    }

    /**
     * Get bans information by player ID.
     *
     * @param int $id
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\BansModel
     */
    public function bans(int $id): BansModel
    {
        $result = $this->request->execute('bans/' . $id);

        return new BansModel($result);
    }

    /**
     * Get server information.
     *
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\ServersModel
     */
    public function servers(): ServersModel
    {
        $result = $this->request->execute('servers');

        return new ServersModel($result);
    }

    /**
     * Get the current game time
     *
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\GameTimeModel
     */
    public function gameTime(): GameTimeModel
    {
        $result = $this->request->execute('game_time');

        return new GameTimeModel($result);
    }

    /**
     * @deprecated
     *
     * @throws \Exception
     * @throws \Http\Client\Exception
     * @return \TruckersMP\Models\VersionModel
     */
    public function version(): VersionModel
    {
        $result = $this->request->execute('version');

        return new VersionModel($result);
    }
}
{'fraction_non_alphanumeric': 0.13550399688048353, 'fraction_numerical': 0.0003899395593682979, 'mean_word_length': 2.296915167095116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '3547465', 'n_tokens_mistral': 1594, 'n_tokens_neox': 1540, 'n_words': 335}